Hello,
I am wondering how to make a counter using three PushButtons. using ARD Uno R3.
I have this code :
#include <TimerOne.h>
#include <Wire.h>
#include <MultiFuncShield.h>
void setup()
{
Timer1.initialize();
MFS.initialize(&Timer1); // initialize multi-function shield library
MFS.write("Hi");
delay(2000);
MFS.write(-273);
delay(2000);
MFS.write(3.141, 2); // display to 2 decimal places.
delay(2000);
}
int counter=0;
byte ended = false;
void loop()
{
if (counter < 200)
{
MFS.write((int)counter);
counter++;
}
else if (!ended)
{
ended = true;
MFS.write("End");
MFS.blinkDisplay(DIGIT_ALL, ON);
}
delay(50);
}
for this one, when I push the button A1, it will count up to a certain number. i.e in this one I have sit to 200 then show me a string " end" or maybe anything.
now I have to adjust this code to
switch 1 will count up to a certain number and stop at that number.
switch 2 will count down to zero and stop.
switch 3 will be Reset. I have tried many times to do that but scratched!. wasted.
could you please make it using multifuntion shield ...
thanks