Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions