-
You Reply: Thanks Hector,
I'll test that! But in the online Manual from the Romeo it's said they are connected to Analog0? In addition I used a 1 to 1 copy of the sample code from that manual PDF :-(
I'll let you know if it reads out correctly on Analog07.
But another quick question, why does it read out those 270 values on the pins where nothing is connected to?
Thanks
-
You Reply: No one with any Info on this behavior?
Any Info from DFRobot maybe would be nice, because if my Board is damaged I would like to give it back within my 14-day money back guarantee i have with the reseller I bought it from.
-
You Reply: Hi Hector,
thank you for your reply and trying to help me.
I'm using the example code from the romeo manual with which the errors subscribed in my first post appear. After trying your code it looks the same. The jumpers are correctly in place, just doublechecked it. Buttons S6 + S7 work correct it's just with buttons 1-5.
It seems as if there is some kind of current flowing through the analog pins that disturbs the function of the buttons?
How are those (S1-S5) connected to the analog input? Are there any pull-up / pull-down resistors in place? As mentioned the analog reading is around 270 the whole time (for all analog in pins that is).
The code I use to read this is just a simple
analogRead(0) inside a serial output paired with a delay(250) after every read.
Serial console output looks like this (for analog 0 / Buttons S1-S5)
270
270
270
270
270
271
272
269
270
270
269
<---- Now I press a Button S1-S5 (it's really no difference which button I press to what happens here!!!)
259
258
260
261
255
258
260
<--- I release the above pressed Button
268
269
270
271
270
272
270
.... and so on
As mentioned, this happens exactly like that no matter which of the 5 (S1-S5) Buttons I press. If I put a pull-down resistor in place from ground to analog 0 then the reading is constantly "0" of course, but nothing at all happens when i press a button. When I put a pull up resistor in place the reading is as expected constantly 1023 but also nothing happens when pressing the buttons :-/
So is my analog input damaged? Is this because of the USB power from the PC so it is like some electrical disturbance to the analo readings? Are the buttons defect?
Any further help greatly appriciated :-)