Hi,
We are two students who are creating an physical electronic boardgame. But we don't have a lot of experience with arduino and electronics.
The way it works is there are little powercircuits on a tile, the player needs to connect the tiles together. Every tile is connected to a (digital) arduino port.
To get this working we needed to get the state of the port. It was working last week but isn't this week. Which is actually kind of strange and we don't know why.
Last week it was reading the right high and low states, this week it is just randomly doing something. And if it's working it just gives 3 times the right and 3 times the wrong state.
We have read about floating power but do not now a solution.
I hope you understand what we mean.
Could someone help us, please?
Thank you in advance for your time and advice!
Greetings,
Ingrid & Eveline
This is our code:
(We know it is not efficient)
void setup()
{
Serial.begin(9600);
pinMode(13, INPUT);
pinMode(12, INPUT);
pinMode(11, INPUT);
pinMode(10, INPUT);
pinMode(9, INPUT);
pinMode(8, INPUT);
pinMode(7, INPUT);
pinMode(6, INPUT);
pinMode(5, INPUT);
}
void loop()
{
int value13 = digitalRead(13);
int value12 = digitalRead(12);
int value11 = digitalRead(11);
int value10 = digitalRead(10);
int value9 = digitalRead(9);
int value8 = digitalRead(8);
int value7 = digitalRead(7);
int value6 = digitalRead(6);
int value5 = digitalRead(5);
Serial.print("poort 13 =");
Serial.println(value13, DEC);
Serial.print("poort 12 =");
Serial.println(value12, DEC);
Serial.print("poort 11 =");
Serial.print(value11, DEC);
Serial.println("");
Serial.print("poort 10 =");
Serial.print(value10, DEC);
Serial.print("poort 9 =");
Serial.print(value9, DEC);
Serial.print("poort 8 =");
Serial.print(value8, DEC);
Serial.println("");
Serial.print("poort 7 =");
Serial.print(value7, DEC);
Serial.print("poort 6 =");
Serial.print(value6, DEC);
Serial.print("poort 5 =");
Serial.print(value5, DEC);
Serial.println("");
delay(2000);
}