Question: Convert the following psuedo code to an Arduino program: The structure of the interrupt routines for handling the encoders are included below. The test of

Convert the following psuedo code to an Arduino program:

Convert the following psuedo code to an Arduino program: The structure of

The structure of the interrupt routines for handling the encoders are included below. The test of the encoders and our code will be to simply display the encoder value every 0.1 seconds Functions Needed: attachlnterrupt Interrupt, ISR. mode ) Program Structure: Global Variable encoderPosition Interrupt service routines. void MonitorA0 if input A and input B are equal input A and input B are pins 2 and 3 respectively Increment encoderPosition. else Decrement encoderPosition void MonitorBO if input A and input B are equal Decrement encoderPosition. Note this is the opposite of what happens above! else Increment encoderPosition. SetUp: Attach MonitorA to interrupt 0, (Pin 2) and set mode for any change Attach MonitorB to interrupt 1, (Pin 3) and set mode for any change. Loop ds display encoderPosition on LCD screen. Lab Assignment: Prelab: Write the program described in the program section. The structure of the interrupt routines for handling the encoders are included below. The test of the encoders and our code will be to simply display the encoder value every 0.1 seconds Functions Needed: attachlnterrupt Interrupt, ISR. mode ) Program Structure: Global Variable encoderPosition Interrupt service routines. void MonitorA0 if input A and input B are equal input A and input B are pins 2 and 3 respectively Increment encoderPosition. else Decrement encoderPosition void MonitorBO if input A and input B are equal Decrement encoderPosition. Note this is the opposite of what happens above! else Increment encoderPosition. SetUp: Attach MonitorA to interrupt 0, (Pin 2) and set mode for any change Attach MonitorB to interrupt 1, (Pin 3) and set mode for any change. Loop ds display encoderPosition on LCD screen. Lab Assignment: Prelab: Write the program described in the program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!