Hi Geoff.
Got the variables to work ok. However I have problems with the display. When compiling get this error Error class liquid crystal has no member named 'clear'
I would like the lcd to give the values of a,b...f during the delay at the end before the next cycle starts. Three columns as such
a c e
b d f
Here is what I have done so far
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// here I want to enter the values of a,b,c,d,e,f, so that they will be entered automatically below
// since negatives aren't going to be used, unsigned integer type gives twice the maximum size of normal integers
unsigned int a = 55; // size of first drop in ms (best size for trajectory)
unsigned int b = 85; // time between 1st and 2nd drops
unsigned int c = 55; // size of second drop in ms
unsigned int d = 85; // time between 2nd and 3rd drops
unsigned int e = 55; // size of third drop in ms
unsigned int f = 5000; // 5 sec before restarting
void setup() {
// initialize the digital pins as an output.
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
}
void loop() {
digitalWrite(6, HIGH); // Turns ON Relay 3 on digital pin 6 (blue)
delay(a); // size of drop in ms best size for trajectory
digitalWrite(6, LOW); // Turns OFF Relay 3 on digital pin 6
delay(b); // time between 1st and 2nd drops
digitalWrite(7, HIGH); // Turns ON Relay 2 on digital pin 7 (yellow)
delay(c); // size of drop in ms
digitalWrite(7, LOW); // Turns OFF Relay 2 on digital pin 7
delay(d); // time between 2nd and 3rd drops
digitalWrite(8, HIGH); // Turns ON Relay 1 on digital pin 8 (red)
delay(e); // size of drop in ms
digitalWrite(8, LOW); // Turns OFF Relay 1 on digital pin 8
// here I want the display info
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(" a c e ");
// b d f
delay(f); // Delay before recycling
}
Moderator edit: Code tags added.