#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11, 5, 4, 3, 2);
int ss=0;
int mm=32;
int hh=16;
void setup(){
lcd.begin(16, 2);
}
void loop()
{
for (ss=0; <60; ss++){ //los segs van de 0 a 60 y otra vez, y durante este perÃodo:
lcd.clear();
lcd.setCursor(3,0);
lcd:print("Hsr");
lcd.setCursor(4,1);
lcd.print(hh);
lcd.setCursor(6,1);
lcd.print(":")
lcd.setCursor(7,0)
lcd.print("Min")
lcd.setCursor(7,1)
lcd.print(mm);
lcd.setCursor(9,1);
lcd.print(":");
lcd.setCursor(11,0);
lcd.print("seg");
lcd.setCursor(12,1);
lcd.print(ss);
delay(1000);
}
if( ss > 59){
ss=00;
mm=mm+1;}
if( ss > 59){
ss=00;
hh=hh+1;}
if( hh>=24){
hh = 00;
mm = 00;
ss = 00;
}
}
There are quite a lot of mistakes that you can identify quite easily once the code is auto formatted with a ctrl-T:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int ss = 0;
int mm = 32;
int hh = 16;
void setup() {
lcd.begin(16, 2);
}
void loop()
{
for (ss = 0; < 60; ss++) { //los segs van de 0 a 60 y otra vez, y durante este perÃodo:
lcd.clear();
lcd.setCursor(3, 0);
lcd: print("Hsr");
lcd.setCursor(4, 1);
lcd.print(hh);
lcd.setCursor(6, 1);
lcd.print(":")
lcd.setCursor(7, 0)
lcd.print("Min")
lcd.setCursor(7, 1)
lcd.print(mm);
lcd.setCursor(9, 1);
lcd.print(":");
lcd.setCursor(11, 0);
lcd.print("seg");
lcd.setCursor(12, 1);
lcd.print(ss);
delay(1000);
}
if ( ss > 59) {
ss = 00;
mm = mm + 1;
}
if ( ss > 59) {
ss = 00;
hh = hh + 1;
}
if ( hh >= 24) {
hh = 00;
mm = 00;
ss = 00;
}
}
system
September 25, 2017, 9:27pm
3
for (ss = 0; < 60; ss++)
While what is less than 60?
Hi,
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Thanks.. Tom..