OK so I wrote this program :
/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints "Hello World!" to the LCD
and shows the time.
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/
// include the library code:
#include <LiquidCrystal.h>
#include <Time.h>
int ldr = 1;
int light;
//LiquidCrystal lcd(RS,EN,D0,D1,D2,D3,D4,D5,D6,D7);
LiquidCrystal lcd(7,8,2,3,4,5,9,10,11,12);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 4);
// Print a message to the LCD.
lcd.print("Hr Mn Sc Value");
setTime(10,10,0,6,3,2011);
Serial.begin(9600);
}
void loop() {
light = analogRead(ldr);
Serial.println(light);
lcd.setCursor(0,1);
lcd.print(" ");
if (light > 750) {
lcd.setCursor(0,1);
lcd.print(hour());
lcd.setCursor(3,1);
lcd.print(minute());
lcd.setCursor(6,1);
lcd.print(second());
lcd.setCursor(10,1);
lcd.print(light);
delay(1000);
}
}
I want to log the time and value of the LDR on the LCD but at night. I want it to give me 3 values + the time they occurred. I want to evenly space out the measuring periods so there’s only 3 of them. the 750 that I wrote in the code will NOT be implemented in the final code. Basically lets say the arduino says , oh its time to take a measurement, then it takes the measurement and logs the time it was taken and puts it on the LCD. Then after another allocated time it takes another measurement and does the same thing but on a new line. How would I get it to do this on a new line and with a delay?