Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The counter must stop at Zero and should not go to minus, where i need to modify the code. void setup() { Serial.begin (9600); 0

image text in transcribed

The counter must stop at Zero and should not go to minus, where i need to modify the code.

void setup() { Serial.begin (9600); 0 COMS pinMode (2, INPUT_PULLUP); // internal pullup input pin 2 pinMode (3, INPUT_PULLUP); // internal pullup input pin 3 0.42 // Setting up interrupt The Counter Should 0.20 0.12 Stop at zero, and 1/A rising pulse from encodenren activated aio(). AttachInterrupt 0 is DigitalPin 0.09 should NOT go to 0.08 attachInterrupt(0, aio, RISING); 0.05 minus. 0.01 //B rising pulse from encodenren activated ail(). AttachInterrupt 1 is DigitalPin 0.00 attachInterrupt(1, ai, RISING); -0.02 -0.06 Where to Modify the -0.01 void loop 04 -0.00 code? // Send the value of counter 0.06 if( counter != temp ) { 0.05 delay(100); // 100 millie second delay added due to flickering on the screen 0.04 Serial.println (counter/201.54); lcd.begin(16, 2); lcd.print("Used Wire (cm)"); Autoscrol Show timestamp lcd.setCursor(0,1); lcd.print(counter/201.54); //diameter of wheel is 65mm, the circumference is 195mm = 19.5 cm = 0.64ft temp counter; } } void aio() { // aio is activated if DigitalPin number 2 is going from LOW TO HIGH 1/ Check pin 3 to determine the direction if (digitalRead(3) ==LOW){ counter++; Jelse { counter

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

More Books

Students also viewed these Databases questions