LCD-1602

void setup()
{
 // initialize outputs
 pinMode(9, OUTPUT);
 pinMode(8, OUTPUT);
 pinMode(7, OUTPUT);
 pinMode(6, OUTPUT);
 pinMode(5, OUTPUT);
 
 // initialize 4 as input
 pinMode(4, INPUT_PULLUP);
}


void loop()
{

while (digitalRead(4) == LOW)  // Will be executed while button on pin 4 is pressed and therefore pin 4 is connected to GND
{
 digitalWrite(9, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(1000);              // wait for a second
 digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(3000);              // wait for a second
 digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(1000);              // wait for a second
 digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(1000);              // wait for a second
 digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
 delay(1000);              // wait for a second
 digitalWrite(9, LOW);    // turn the LED off by making the voltage LOW
 delay(1000);              // wait for a second
 digitalWrite(5, HIGH); 
 (delay(1000)) ; 
 digitalWrite(6, HIGH);  // turn the LED on (HIGH is the voltage level)
 delay(20000);              // wait for a second   delay(20000);
 digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(1000);              // wait for a second
 digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
 delay(1000);              // wait for a second
 digitalWrite(5, LOW);    // turn the LED off by making the voltage LOW
 delay(1000);              // wait for a second
 digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(20000);              // wait for a second
 digitalWrite(7, LOW);    // turn the LED off by making the voltage LOW
 delay(1000);              // wait for a second
 digitalWrite(8, LOW);    // turn the LED off by making the voltage LOW
 delay(1000);              // wait for a second
 digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
 delay(1000);              // wait for a second
}

//Any Other Task here
delay(100);

}

i want what was displayed timing all outputs or Start-End or eny text… can you heph me?

i want what was displayed timing all outputs or Start-End or eny text… can you heph me?

Sorry, but I don’t understand your problem.
Do you want a LCD display (16x2) print, what the status of the LED actions is?

So:
if LED6 is turned ON, you want to display that information on the screen?

If so, have a look at the basic information how to set up a LCD display with a library.
Run the “hello World” sketch first to make sure, that something shows up on the screen to exclude display problems.

If you haven’t bought the LCD display yet you can start with Serial.print and when that is running as you want you can then easily transfer everything to the LCD display.

AND: pls use the </> button when posting your code.

So:
if LED6 is turned ON, you want to display that information on the screen?

If so, have a look at the basic information how to set up a LCD display with a library.
Run the "hello World" sketch first to make sure, that something shows up on the screen to exclude display problems.

If you haven't bought the LCD display yet you can start with Serial.print and when that is running as you want you can then easily transfer everything to the LCD display


I have already run the "hello world" and it showed up on screen but I can't do the same with my own code so I want to know how to run my code, I mean timers of pin9,pin8, pin7, pin6, pin5. Also when it will finished I want to show up "end of process" phrase on screen.

Why are you hesitating to post your code?

here is my code:

void setup()
{
// initialize outputs
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);

// initialize 4 as input
pinMode(4, INPUT_PULLUP);
}


void loop()
{

while (digitalRead(4) == LOW)  // Will be executed while button on pin 4 is pressed and therefore pin 4 is connected to GND
{
digitalWrite(9, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);              // wait for a second
digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(3000);              // wait for a second
digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);              // wait for a second
digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);              // wait for a second
digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(9, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(5, HIGH); 
(delay(1000)) ; 
digitalWrite(6, HIGH);  // turn the LED on (HIGH is the voltage level)
delay(20000);              // wait for a second   delay(20000);
digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);              // wait for a second
digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(5, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(20000);              // wait for a second
digitalWrite(7, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(8, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
}

//Any Other Task here
delay(100);

}

I can’t understand why it is so difficult to read and understand the forum rules and make it easier for the people who want to assist the PO’s.
So: I only will step in again when the code is in codetags “</>”. Sorry, but I am a bit tired to repeat this over and over again.

Please select [Edit-Modify] for your posted messages.

Select the code with your mouse. Click the [</>] icon.
Then check everything works with the [Preview] button.

If you obey the Forum rules, you will get very good replies.

David.

david_prentice:
Please select [Edit-Modify] for your posted messages.

Select the code with your mouse. Click the [</>] icon.
Then check everything works with the [Preview] button.

If you obey the Forum rules, you will get very good replies.

David.


WoW )))))

At least you learned how to use the 'Quote' function, so we are getting somewhere.

Don

Thanks for learning how to use the code tags.

In your sketch there is no LCD code included.
And: is it working with the LED's and button press at all?

As we don't know if you are using an LCD with I2C or SPI or "direct" wiring - we can't hepl you with the constructor. But you told us, that the "Hello World" showed up in the display.

Then start using this setup as in the HW-sketch.
Define the output pins and give them "readable" names, such as LED_RED = 5, LED_BLUE = 6 etc.; this makes a code better readable and "debuggable" - maybe not needed here, but it's a good habit, especially when you start with bigger codes or if you are expanding existing ones.

In the loop you might then

  • set cursor to first line, first column of the LCD
  • print first line something like "LED Chain"
  • switch on LED_RED with a "HIGH" and add the delay line
  • second line "1-0-0-0-0" // which means LED_RED is on, all others out
  • switch on LED_BLUE plus delay
  • set the cursor to the beginning of the second line
  • print "1-1-0-0-0" // which means LED_RED AND LED_BLUE are ON, all the rest out
    .....

I don't know if it is that what you wanted to do, but you have an idea now how it can work.
If you want to include the timers for each LED - you know how many characters you have on a 16x2 LCD?

Maybe you can print
"1-1-1-1-1" on the first line (= all LEDs ON) and
"1-1-1-1-3" on the second line, when you interpret the 1 as 1000ms for LEDs 1-4 and the 3 as 3000ms for LED5.

And at the end:
Clear the lcd and print "Process done" and e.g. a 10sec delay.
Be aware that the loop will start over and over again.

I don't know if it is that what you wanted to do, but you have an idea now how it can work.
If you want to include the timers for each LED - you know how many characters you have on a 16x2 LCD?

Maybe you can print
"1-1-1-1-1" on the first line (= all LEDs ON) and
"1-1-1-1-3" on the second line, when you interpret the 1 as 1000ms for LEDs 1-4 and the 3 as 3000ms for LED5.

And at the end:
Clear the lcd and print "Process done" and e.g. a 10sec delay.
Be aware that the loop will start over and over again.
[/quote]


I have LCD - 16x2 screen, and I would like that the screen is turned on to write "hello ******"
and then i press button Start, was written "Start" on the LCD...then I want to display a timer, such as: [ top LED - 1(led-2; led-3; led-4; led-5) and below the appropriate time (Timer) (seconds) ]... and finally write "process completed" ))) it will be perfect for me... Of course if it is possible, if not, then the timer to appear !... in advance thank you very much ...

I retract Reply #8.

You know how to use the "Quote function (at the bottom of the reply) which will quote the entire reply but not the Quote tag (which looks like a cartoon 'bubble') that can be used to quote just a portion of the reply.

Have you considered reading the instructions --> How to use this forum - please read.?

Don

Post your "Hello World" sketch so we can see what constructor works with your display.
Your project is pretty easy to do but you have to invest a little bit more and pls follow the rules of the forum.

They are set up to ease the life of the PO, the supporters and the readers.

rpt007:
Post your “Hello World” sketch so we can see what constructor works with your display.
Your project is pretty easy to do but you have to invest a little bit more and pls follow the rules of the forum.

They are set up to ease the life of the PO, the supporters and the readers.

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 10, 4, 3, 2);

void setup() {
 // set up the LCD's number of columns and rows:
 lcd.begin(16, 2);
 // Print a message to the LCD.
 lcd.print("hello, world!");
}

void loop() {
 // set the cursor to column 0, line 1
 // (note: line 1 is the second row, since counting begins with 0):
 lcd.setCursor(0, 1);
 // print the number of seconds since reset:
 lcd.print(millis() / 1000);
}

and my codes pins is " pin-9; 8; 7; 6; 5; "

OMG, why can't you post your code according to the rules of the forum?

ok, now it’s ok.
Let me have a look at the sketch and then I will come back to you.

rpt007:
OMG, why can't you post your code according to the rules of the forum?

void setup()
{
// initialize outputs
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);

// initialize 4 as input
pinMode(4, INPUT_PULLUP);
}


void loop()
{

while (digitalRead(4) == LOW)  // Will be executed while button on pin 4 is pressed and therefore pin 4 is connected to GND
{
digitalWrite(9, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);              // wait for a second
digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(3000);              // wait for a second
digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);              // wait for a second
digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);              // wait for a second
digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(9, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(5, HIGH); 
(delay(1000)) ; 
digitalWrite(6, HIGH);  // turn the LED on (HIGH is the voltage level)
delay(20000);              // wait for a second   delay(20000);
digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);              // wait for a second
digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(5, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(20000);              // wait for a second
digitalWrite(7, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(8, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
}

//Any Other Task here
delay(100);

}

OMG2,

this is not true. If you post a code, pls use the </> “Code Tags” like you already did in reply #4 and #13.
You find them at the upper left of your editing screen.

All codes should be within these tags. Why?

  1. The code gets better readable,
  2. you can scroll within the window without losing too much context information
  3. with one click you can copy very long codes into your clipboard and then paste it into one’s editor

Please READ and UNDERSTAND the rules of this forum. For your convenience you will find the suitable link in my signature.
in short: codes in </> and quotes by using the quote-button in the forum editor (as you already did …).

In the meantime I have completed a WORKING CODE based on your sketch in reply #4.
→ I will only post this sketch when you have modified your previous post #16.

rpt007:
OMG, why can't you post your code according to the rules of the forum?

Do not you see my code?

Sorry, but you seem to be resistant to any advice.
What the hack is the problem, to MODIFY your earlier post and put your code in between code tags.

Step by step:

  1. go back to your post #16
  2. move your mouse over “more” (at the lower right)
  3. you will see two options: modify and remove
  4. click on modify
  5. in the editor you will see your full reply #16
  6. highlight the section with your codelines and copy this to your clipboard
  7. click on the upper right symbol of the editor - “</>”= code tags
  8. place the cursor BETWEEN the <> characters
  9. paste the clipboard content
  10. voilà: you have the code between the codetags

Then go and delete the redundant reply #18 (see option2 in step3).
After that I will post the working code.