Maybe this belongs here more than on the networking side, since the problem seems to be with how Fios work. At least hopefully I'll get some answers.
so I have a couple of fios, both the official blue one that requires an FTDI interface card to program and the sparkfun version that has a functioning USB interface. I want to use the board with an xBee as a receiver, with the transmitter sending the position of a couple of switches to the board. I can make that work using an externally mounted xBee chip, but it would be sweet to use the provided sockets. Problem is that most of the examples of using that are for wireless programming of the board, which I don't really care about. I just want to read the incoming packet over the serial port and parse the switch position to drive a servo.
Problem is I can't get anything from the serial port. I certainly can't while the USB interface is connected. Does anyone have a an example of how to read the serial output for a FIO. I've googled around, haven't found any examples of anyone doing what I need to do. Seems like I should just be able to check serial ready and then grab whatever's there. I've set the baud rate to the board's rate (57600) and tried other rate down to 9600 and up. No joy. What am I doing wrong?
Here's a sample of some test code I used. I have a xbee transmitting a packet every second with the receiver set up to get it. Both transmitter and receiver work fine in my version of the electronics that does not use the fio xbee socket.
#include <Servo.h>
Servo myservo;
// Adjustments
int centertrim = 0;
int travel = 30;
int increment = 1;
// Pin definitions
int servoHeading = 90;
int headingValue;
int pos = 90; // variable to store the servo position
void setup(){
myservo.attach(9); // attaches the servo on pin 9 to the servo object
Serial.begin(57600);
}
void loop(){
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
int incomingByte = Serial.read();
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}