ArduinoGeneral

Romeo V2.0[R3] reading A7 (S1-5 buttons) always returns 0

userHead RobotPete 2014-06-13 01:44:12 3048 Views3 Replies
Hi,

I just got my Romeo board and it seems to be working OK, except for the S1-5 buttons. Reading A7 always returns 0 (see attached simple code). The board has not been abused in any way, powering from a computer using USB; the S1-S5 switch is ON (although I tried the OFF position as well, just in case). There is nothing else connected to the board.

[tt]
// Test for S1-5 switch reading on Romeo board
void setup() {
Serial.begin (9600);
}

void loop() {
Serial.println (analogRead (A7));
delay (500);
}

//Output is 0 regardless of S1-S5 button state and the S1-S5 switch position
[/tt]

Am I doing something wrong or is the board defective?

A few other notes on the Wiki docs for RoMeo:
[list type=decimal]
[*]The schematics and layouts show there are A6 and A7 analog inputs provided on the red power connector, next to the RST pin. My board (V2.0[R3]) has IOREF and an unmarked pin there instead. You may want to update the layout/schematics or provide a note.
[*]Are the A6/A7 inputs made available for connecting elsewhere on the board? If not, what's the purpose of having the S1-S5 switch?
[*]What is the purpose and possible use for the Servo PWR connector? Is it in or out? Is it controlled in any way? What would be an example use (connections and code)?
[/list]
Thanks,
- RobotPete
2014-06-19 18:36:55 Thanks

Have a good day!
Anyway, for the small servo, it is no need to use an external battery.
userHeadPic Grey.CC
2014-06-19 16:31:41 Thanks, Grey. That was it.

The vendor had me test the board and, since it failed the documented test, they were kind enough to send a replacement board. That one, of course, had the same "problem". Both the old board and the new one work fine and show the buttons on A0. Maybe we can get the wiki updated regarding the A0 (vs A7) and the layout.

Also thanks on the servo power info - the wiki was not specific enough but I understand now what it is for. I have a small servo, so I will give it a try.

Overall, I think DFRobot have done a fantastic job with this board, integrating the servo and the motor controls. I see what others have to put up with (Uno+motor shield, separate power supplies, etc). This board is just brilliant and easy to use.

Best,
- RobotPete
userHeadPic RobotPete
2014-06-13 10:46:34 Welcome  RobotPete,

The buttons is connect to the AnalogPin(0), not A7.
You could check [url=http://www.dfrobot.com/wiki/index.php/Romeo_V2-All_in_one_Controller_(R3)_(SKU:DFR0225)#Example_use_of_Button_S1-S5]Romeo wiki[/url] about how to use the buttons.

I think A6 and A7 only exist in old version Romeo V1.0 and V1.1. They are using Atmel328p chip, it has Analog 6 and 7. But Romeo V2 is already using Atmel32u4. There is no A6 and A7 on the board.

Anyway, for the Servo PWR, it could power supply the servo power from this port. You know some servo requires a large voltage or current. but arduino board can't provide very high value. so the Servo power will be very convenient in these cases.
userHeadPic Grey.CC