scarygood536
New Member
Hello there,
I hope this is in the right section, seeing how this is a arduino related question. I have written code that allows a Radioshack multicolored LED to rotate between Blue, Green and Red. While that is in it's loop a LCD display reads out the color. Now I added a Title before the colors blink to tell the person what's going to happen. I can't find a way to just get that to appear once, just at the beginning.
I would like the "booting" and "Multicolor led rotation" parts to only appear once in a loop. I'm a beginner to this arduino and C code. Thanks for the help or any input
I hope this is in the right section, seeing how this is a arduino related question. I have written code that allows a Radioshack multicolored LED to rotate between Blue, Green and Red. While that is in it's loop a LCD display reads out the color. Now I added a Title before the colors blink to tell the person what's going to happen. I can't find a way to just get that to appear once, just at the beginning.
Code:
// Blink Multi Color LED +5 common, LCD
#include <LiquidCrystal.h> //LCD library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // set LCD PINS
int BL = 13; // Backlight
// Pin 13 has an LED connected on most Arduino boards.
int ledC = 8;
int ledR = 9;
int ledB = 7;
int ledG = 6;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(ledC, OUTPUT);
pinMode(ledG, OUTPUT);
pinMode(ledB, OUTPUT);
pinMode(ledR, OUTPUT);
pinMode(BL, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop()
{
lcd.begin(16,2); //sets display to start
lcd.setCursor(0, 0); //sets cursor 1st row
lcd.print("Booting...");
delay(1000); //wait for a second
digitalWrite(BL,HIGH); //turn backlight on
digitalWrite(ledC, HIGH); // multi color + pin
digitalWrite(ledR, HIGH); // Stops sourcing of current
digitalWrite(ledG, HIGH); // Stops sourcing of current
digitalWrite(ledB, HIGH); // Stops sourcing of current
lcd.setCursor(0, 0); //Cursor set to top line
lcd.print("MultiColor LED,"); //display text
lcd.setCursor(0, 1); // Sets cursor to 2 row
lcd.print("rotating colors");
delay(5000); // wait in current state for 5 seconds
digitalWrite(ledB, LOW); // Blue LED lights
lcd.begin(16, 2);
lcd.print("Blue");
delay(5000); // wait for 5 seconds
digitalWrite(ledB, HIGH);
digitalWrite(ledG, LOW); //Green LED lights, Blue off
lcd.begin(16, 2);
lcd.print("Green");
delay(5000); //on for 5 seconds
digitalWrite(ledG, HIGH);
digitalWrite(ledR, LOW); //Red LED lights, Green off
lcd.begin(16, 2);
lcd.print("Red");
delay(5000);
digitalWrite(ledR,HIGH); //Red LED off
lcd.begin(16, 2);
lcd.clear(); //Clears LCD display
}
I would like the "booting" and "Multicolor led rotation" parts to only appear once in a loop. I'm a beginner to this arduino and C code. Thanks for the help or any input