myInts[0] = '0' single quotes.
The first zero will drop out, leaving you with just 1, not 01.
myInts[0] = '0' single quotes.
The first zero will drop out, leaving you with just 1, not 01.
I need to "store" the 01 how can i do this?
I need to "store" the 01 how can i do this?
Why? There is ABSOLUTELY no difference between 1, 01, 0x01, 0x0001, 0b00000001, and B00000001.
PaulS:
I need to "store" the 01 how can i do this?
Why? There is ABSOLUTELY no difference between 1, 01, 0x01, 0x0001, 0b00000001, and B00000001.
If i press 1 and then 1 again i will get 11? because let me say i want to set the day for 11 in rtc
Thanks
If i press 1 and then 1 again i will get 11?
Maybe. Or, maybe you'll get "11" or maybe an old banana. We can't see what code you are now using.
[quote author=PaulS link=topic=147319.msg1107087#msg1107087 date=1360178171]
[quote]If i press 1 and then 1 again i will get 11?[/quote]
Maybe. Or, maybe you'll get "11" or maybe an old banana. We can't see what code you are now using.
[/quote]
There are the "old banana" ..... many thanks to HazardsMind
[code if (page == 70 && p.y > 134 && p.y < 162 && p.x > 145 && p.x <185 && x==1){
if (setC==1){
qx=100;
qw=193;
}
if (setC==2){
qx=130;
qw=193;
}
tft.setTextSize(4);
tft.fillRect(qx, qw, 21, 29, BLACK);
tft.setCursor(qx, qw);
// tft.setCursor(100, 193);
myInts[counterrtc++] = '0';
tft.println ("0");
setC = setC + 1;
delay(1000);
}
if (page == 70 && p.y > 290 && p.y < 337 && p.x > 195 && p.x <230 && x==1){
if (setC==1){
qx=100;
qw=193;
}
if (setC==2){
qx=130;
qw=193;
}
tft.setTextSize(4);
tft.fillRect(qx, qw, 21, 29, BLACK);
tft.setCursor(qx, qw);
myInts[counterrtc++] = '1';
tft.println ("1");
setC = setC + 1;
delay(1000);
}
if (page == 70 && p.y > 238 && p.y < 275 && p.x > 195 && p.x <230 && x==1){
if (setC==1){
qx=100;
qw=193;
}
if (setC==2){
qx=130;
qw=193;
}
tft.setTextSize(4);
tft.fillRect(qx, qw, 21, 29, BLACK);
tft.setCursor(qx, qw);
myInts[counterrtc++] = '2';
tft.println ("2");
setC = setC + 1;
delay(1000);
}
if (page == 70 && p.y > 187 && p.y < 226 && p.x > 195 && p.x <230 && x==1){
if (setC==1){
qx=100;
qw=193;
}
if (setC==2){
qx=130;
qw=193;
}
tft.setTextSize(4);
tft.fillRect(qx, qw, 21, 29, BLACK);
tft.setCursor(qx, qw);
myInts[counterrtc++] = '3';
tft.println ("3");
setC = setC + 1;
delay(1000);
}
if (page == 70 && p.y > 137 && p.y < 173 && p.x > 195 && p.x <230 && x==1){
if (setC==1){
qx=100;
qw=193;
}
if (setC==2){
qx=130;
qw=193;
}
tft.setTextSize(4);
tft.fillRect(qx, qw, 21, 29, BLACK);
tft.setCursor(qx, qw);
myInts[counterrtc++] = '4';
tft.println ("4");
setC = setC + 1;
delay(1000);
}
if (page == 70 && p.y > 83 && p.y < 119 && p.x > 195 && p.x <230 && x==1){
if (setC==1){
qx=100;
qw=193;
}
if (setC==2){
qx=130;
qw=193;
}
tft.setTextSize(4);
tft.fillRect(qx, qw, 21, 29, BLACK);
tft.setCursor(qx, qw);
myInts[counterrtc++] = '5';
tft.println ("5");
setC = setC + 1;
delay(1000);
}
if (page == 70 && p.y > 30 && p.y < 69 && p.x > 195 && p.x <230 && x==1){
if (setC==1){
qx=100;
qw=193;
}
if (setC==2){
qx=130;
qw=193;
}
tft.setTextSize(4);
tft.fillRect(qx, qw, 21, 29, BLACK);
tft.setCursor(qx, qw);
myInts[counterrtc++] = '6';
tft.println ("6");
setC = setC + 1;
delay(1000);
}
if (page == 70 && p.y > 290 && p.y < 337 && p.x > 145 && p.x <185 && x==1){
if (setC==1){
qx=100;
qw=193;
}
if (setC==2){
qx=130;
qw=193;
}
tft.setTextSize(4);
tft.fillRect(qx, qw, 21, 29, BLACK);
tft.setCursor(qx, qw);
myInts[counterrtc++] = '7';
tft.println ("7");
setC = setC + 1;
delay(1000);
}
if (page == 70 && p.y > 238 && p.y < 275 && p.x > 145 && p.x <185 && x==1){
if (setC==1){
qx=100;
qw=193;
}
if (setC==2){
qx=130;
qw=193;
}
tft.setTextSize(4);
tft.fillRect(qx, qw, 21, 29, BLACK);
tft.setCursor(qx, qw);
myInts[counterrtc++] = '8';
tft.println ("8");
setC = setC + 1;
delay(1000);
}
if (page == 70 && p.y > 187 && p.y < 226 && p.x > 145 && p.x <185 && x==1){
if (setC==1){
qx=100;
qw=193;
}
if (setC==2){
qx=130;
qw=193;
}
tft.setTextSize(4);
tft.fillRect(qx, qw, 21, 29, BLACK);
tft.setCursor(qx, qw);
myInts[counterrtc++] = '9';
tft.println ("9");
setC = setC + 1;
delay(1000);
}
if (page == 70 && p.y > 80 && p.y < 118 && p.x > 145 && p.x <185 && x==1){ // VERDE VALIDA
//tft.fillRect(30, 201, 50, 21, BLUE);
// tft.drawString(100, 201, "VALIDADO", WHITE, 3);
tft.fillRect(180, 193, 42, 29, BLACK);
tft.setTextSize(4);
tft.setCursor(180, 193);
setC = 0;
x=0;
counterrtc = 0;
selec = atoi(myInts);
tft.println (selec);
if (zz==1){
a = selec;
zz=0;
}
if (zz==2){
me = selec;
zz=0;
}
if (zz==3){
ds = selec;
zz=0;
}
if (zz==4){
dm = selec;
zz=0;
}
if (zz==5){
h = selec;
zz=0;
}
if (zz==6){
mi = selec;
zz=0;
}
while(counterrtc != 0) { // this can be used for any size array. myInts[counterrtc] = '\0';
myInts[counterrtc--] = 0;
}
delay(2000);
tft.fillRect(20, 193, 220, 33, BLACK);
}
if (page == 70 && p.y > 34 && p.y < 66 && p.x > 145 && p.x <185 ){ // VERMELHO APGAGA // VERMELHO APGAGA // VERMELHO APGAGA
tft.fillRect(20, 193, 220, 33, BLACK);
tft.setTextSize(4);
tft.setCursor(100, 193);
counterrtc = 0;
selec = '\0';
while(counterrtc != 0) { // this can be used for any size array. myInts[counterrtc] = '\0';
myInts[counterrtc--] = 0;
}
myInts[2] = '\0';
}
if (page == 70 && p.y > 265 && p.y < 330 && p.x > 110 && p.x < 135 ){ // ANO ANO ANO ANO
tft.setTextSize(4);
tft.fillRect(20, 193, 70, 29, BLACK);
tft.setCursor(20, 193);
tft.println ("ANO");
x=1;
setC=1;
zz=1;
delay(1000);
}
if (page == 70 && p.y > 190 && p.y < 250 && p.x > 110 && p.x < 135 ){ // MES MES MES MES Y 190 250 X 110 135
tft.setTextSize(4);
tft.fillRect(20, 193, 70, 29, BLACK);
tft.setCursor(20, 193);
tft.println ("MES");
zz=2;
x=1;
setC=1;
// char mes[2];
// byte coumes;
delay(1000);
}
if (page == 70 && p.y > 105 && p.y < 167 && p.x > 110 && p.x < 135 ){ //DIA SEM DIA SEM DIAS EM
tft.setTextSize(2);
tft.fillRect(20, 193, 80, 31, BLACK);
tft.fillRect(25, 224, 75, 2, BLACK);
tft.setCursor(40, 193);
tft.println ("DIA");
tft.setCursor(25, 210);
tft.println ("SEMANA");
zz=3;
x=1;
setC=1;
// char mes[2];
// byte coumes;
delay(1000);
}
if (page == 70 && p.y > 25 && p.y < 90 && p.x > 110 && p.x < 135 ){ //DIA DIA DIA DIA DIA DIA DIA DIA DIA DIA
tft.setTextSize(4);
tft.fillRect(20, 193, 70, 29, BLACK);
tft.setCursor(20, 193);
tft.println ("DIA");
zz=4;
x=1;
setC=1;
// char mes[2];
// byte coumes;
delay(1000);
}
if (page == 70 && p.y > 265 && p.y < 330 && p.x > 65 && p.x < 100 ){ //HORA HORA HORA HORA HORA
tft.setTextSize(3);
tft.fillRect(20, 193, 70, 29, BLACK);
tft.setCursor(20, 198);
tft.println ("HORA");
zz=5;
x=1;
setC=1;
// char mes[2];
// byte coumes;
delay(1000);
}
if (page == 70 && p.y > 190 && p.y < 250 && p.x > 65 && p.x < 100 ){ // MINUTO MINUTO MINUTO MINUTO
tft.setTextSize(4);
tft.fillRect(20, 193, 70, 29, BLACK);
tft.setCursor(20, 193);
tft.println ("MIN");
zz=6;
x=1;
setC=1;
// char mes[2];
// byte coumes;
delay(1000);
}
if (page == 70 && p.y > 105 && p.y < 167 && p.x > 65 && p.x < 100 ){ // EVENTO EVENTO EVENTO EVENTO
tft.setTextSize(3);
tft.fillRect(20, 193, 220, 33, BLACK);
tft.setCursor(20, 198);
tft.println ("EVENTO");
delay(1500);
tft.fillRect(20, 193, 220, 33, BLACK);
}
if (page == 70 && p.y > 25 && p.y < 90 && p.x > 65 && p.x < 100 ){ // ENTER ENTER ENTER ENTER ENTER
tft.setTextSize(4);
tft.fillRect(20, 193, 220, 33, BLACK);
tft.setCursor(20, 193);
tft.println ("ENTER");
counterrtc = 0;
selec = '\0';
while(counterrtc != 0) { // this can be used for any size array. myInts[counterrtc] = '\0';
myInts[counterrtc--] = 0;
}
myInts[2] = '\0';
ds1307setup();
delay(2000);
tft.fillRect(20, 193, 220, 33, BLACK);
}]
If i can hellp any one please let me know