Thanks for the replies, very helpful.
This is part of the code that I want count with from the sensor. It will eventually have more zones and successfully looped using the small delay when I tried it on my breadboard.
It is my first attempt with Arduino and although I'm sure it could be improved no end I was pleased to get it running with some help from a friend.
Due to bringing the wrong memory stick with me I do not have the version where I tried incrementing using attached interrupt, sorry.
I did think that perhaps I should practice adding attached interrupt to blink as pratice when I return?
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
//int ledPin = 13;
int ledPin = 2;
int switch1 = 3;
int count;
void setup()
{
Serial.begin(9600); // Used to type in characters
lcd.begin(16, 2);// set up the LCD's number of columns and rows:
lcd.setCursor(2, 0); // Print a message to the LCD.
lcd.print("Rail Squirt"
delay (2000);
lcd.setCursor(0,1);
lcd.print(" by Peter Bell"
delay (2000);
lcd. clear();
lcd.print(" Version 2.7M" //Version
lcd.setCursor(2, 1);
lcd.print(" 10-10-18"
pinMode(ledPin, OUTPUT);
delay (4000);
lcd. clear();
delay(1000);
}
void loop()
{
Serial.begin(9600);
Serial.println(count);
lcd.setCursor(2, 0);
lcd.print("Zone" // ZONE 1 OFF
lcd.setCursor(9, 0);
lcd.print("1 OFF"
if (count > 155 && count < 175) {
digitalWrite(ledPin, HIGH);// output on
lcd. clear();
lcd.setCursor(2, 0);
lcd.print("Zone" // ZONE 1 ON
lcd.setCursor(9, 0);
lcd.print("1 ON"
}
lcd.setCursor(9, 0);
lcd.print("8 ON"
if (count > 175 && count < 1500) {
digitalWrite(ledPin, LOW); //output off
lcd. clear();
lcd.setCursor(2, 0);
lcd.print("Zone" // ZONE 8 OFF
lcd.setCursor(9, 0);
lcd.print(" END"
}
count ++ ;
lcd.setCursor(6,1);
lcd.print(count);
delay(200);
if (count == 1500) count = 0; //re-sets
lcd. clear();
}