Question: Create package spec and body for ADC. The analog - to - digital converter ( ADC ) will be used to read throttle values from
Create package spec and body for ADC. The analogtodigital converter ADC will be used to read throttle values from the hand controller.
Your first task is to create a package specification for the ADC. You can find information on the ADC in the CIODASJr Register Map in the tcctemplate's docs directory. Once you have completed the specification, submit it to me for review as a merge request.
Once your specification has been approved, you may implement the body of the ADC driver. Don't forget to make your ADC 'safe' for multiple tasks!!
Note: The multiplexer unit on our ADC occasionally introduces an error when you change channels. To remove this error, do the conversion twice. Use the second value you compute as your result.
Consult the Hand Controller Interface document in the tcctemplate docs folder for more information about the ADC's address. The pictures are the documents to consult. I need to use this semaphore in the ADA code: Semaphore to ensure mutual exclusion
protected type ADCSemaphore is
entry Wait;
procedure Signal;
private
InUse: Boolean : False;
end ADCSemaphore;
protected body ADCSemaphore is
entry Wait when not InUse is
begin
InUse : True;
end Wait;
procedure Signal is
begin
InUse : False;
end Signal;
end ADCSemaphore;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
