/* Bulb Counter */
/* Define const pins For BCD PushWheels */
const byte Pins[8] = {2, 3, 4, 5, 6, 7, 8, 9};
const byte Values[8] = {10, 20, 40, 80, 1, 2, 4, 8};
/* End Define for BCD PushWheels */
byte bcdtot;
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
delay(50);
/* Set BCD Pins to be INPUTS */
for (int p = 0; p < 8; p++)
pinMode(Pins[p], INPUT);
// Read the BCD pins and calculate the value
bcdtot = 0; // You forgot this part
for (int p = 0; p < 8; p++)
{
if (digitalRead(Pins[p]) == HIGH)
{
bcdtot += Values[p];
}
}
Serial.print("bcdtot: ");
Serial.println(bcdtot);
delay(1000);
}
void loop() {}