I want to show sensor values(cds) to 7segment X4
I've programed this far but I can't do more that 7segment X4 show cdsValue
(+ I want to program that if cdsValue is high than certain price, 7segment X4 show up)
I would like to get your advise.
int segmentLEDs[] = {2, 3, 4, 5, 6, 7, 8, 9};
int segmentLEDsNum = 8;
int digitForNum[10][8] = {
{0, 0, 0, 0, 0, 0, 1, 1}, //0
{1, 0, 0, 1, 1, 1, 1, 1}, //1
{0, 0, 1, 0, 0, 1, 0, 1}, //2
{0, 0, 0, 0, 1, 1, 0, 1}, //3
{1, 0, 0, 1, 1, 0, 0, 1}, //4
{0, 1, 0, 0, 1, 0, 0, 1}, //5
{0, 1, 0, 0, 0, 0, 0, 1}, //6
{0, 0, 0, 1, 1, 1, 1, 1}, //7
{0, 0, 0, 0, 0, 0, 0, 1}, //8
{0, 0, 0, 0, 1, 0, 0, 1} //9
{1, 1, 1, 1, 1, 1, 1, 0)} //.
};
int cds = A1;
void setup() {
for (int i = 0 ; i < segmentLEDsNum ; i++) {
pinMode(segmentLEDs*, OUTPUT);*
-
}*
-
Serial.begin(9600);*
}
void loop() {
. -
int cdsValue = analogRead(cds);*
-
Serial.print("cds = ");*
-
Serial.println(cdsValue);*
-
if(cdsValue>500){*
-
}*
}[/td]
[/tr]
[/table]