I tried, using control T, below is the result. All I am trying to do is if x = 1 I want to display only the numeral 1, I do not want to display a zero, delay, then the numeral 1. I know for experienced programmers this is not a problem but for me it is. The code below displays first the numeral 0 then after the delay it displays the numeral 1, and keeps repeating the sequence. I would like for it to display the 1 and keep it on the display.
#include <LedControl.h>
LedControl lc=LedControl(12,11,10,1);
int x = 1;
void setup(){
lc.shutdown(0,false); // power-saving mode on startup
lc.setIntensity(0,15); // Set the brightness to maximum value
lc.clearDisplay(0); // and clear the display
}
void Display() {
/* here is the data for the characters */
byte zero[8]= {
0x00,0x18,0x24,0x24,0x24,0x24,0x18,0x00 };
byte one[8]= {
0x00,0x30,0x10,0x10,0x10,0x10,0x38,0x00 };
if (x=0);
{
for (int n = 0; n < 8; n++){
lc.setRow(0,n,zero[n]);
}
delay(2000);
}
if (x=1);
{
for (int n = 0; n < 8; n++){
lc.setRow(0,n,one[n]);
}
delay(2000);
}
}
void loop(){
Display();
delay(2000);
}