LCD-1602
code: [select]
void setup()
{
// initialize outputs
pinmode(9, output);
pinmode(8, output);
pinmode(7, output);
pinmode(6, output);
pinmode(5, output);
// initialize 4 input
pinmode(4, input_pullup);
}
void loop()
{
while (digitalread(4) == low) // executed while button on pin 4 pressed , therefore pin 4 connected gnd
{
digitalwrite(9, high); // turn led on (high voltage level)
delay(1000); // wait second
digitalwrite(6, high); // turn led on (high voltage level)
delay(3000); // wait second
digitalwrite(8, high); // turn led on (high voltage level)
delay(1000); // wait second
digitalwrite(7, high); // turn led on (high voltage level)
delay(1000); // wait second
digitalwrite(6, low); // turn led off making voltage low
delay(1000); // wait second
digitalwrite(9, low); // turn led off making voltage low
delay(1000); // wait second
digitalwrite(5, high);
(delay(1000)) ;
digitalwrite(6, high); // turn led on (high voltage level)
delay(20000); // wait second delay(20000);
digitalwrite(6, high); // turn led on (high voltage level)
delay(1000); // wait second
digitalwrite(6, low); // turn led off making voltage low
delay(1000); // wait second
digitalwrite(5, low); // turn led off making voltage low
delay(1000); // wait second
digitalwrite(6, high); // turn led on (high voltage level)
delay(20000); // wait second
digitalwrite(7, low); // turn led off making voltage low
delay(1000); // wait second
digitalwrite(8, low); // turn led off making voltage low
delay(1000); // wait second
digitalwrite(6, low); // turn led off making voltage low
delay(1000); // wait second
}
//any other task here
delay(100);
}
i want displayed timing outputs or start-end or eny text... can heph me?
quote
i want displayed timing outputs or start-end or eny text... can heph me?sorry, don't understand problem.
do want lcd display (16x2) print, status of led actions is?
so:
if led6 turned on, want display information on screen?
if so, have @ basic information how set lcd display library.
run "hello world" sketch first make sure, shows on screen exclude display problems.
if haven't bought lcd display yet can start serial.print , when running want can transfer lcd display.
and: pls use </> button when posting code.
Arduino Forum > Using Arduino > Displays > LCD-1602
arduino
Comments
Post a Comment