I am trying to set up serial communication between Arduino and Mac via Bluetooth and the problem.
My environment is this:
- Arduino uno
- Sparkfun Bluetooth Mate
- MacBook, OS X 10.7
First I programmed arduino as shown below, as shown in this tutorial .
int counter = 0;
int incomingByte;
void setup() {
Serial.begin(115200);
}
void loop() {
if (Serial.available() > 0) {
incomingByte = Serial.read();
if (incomingByte == 'R') {
Serial.println("RESET");
counter=0;
}
}
Serial.println(counter);
counter++;
delay(250);
}
This worked well when the Arduino was connected to USB. (The Arduino console accepts a sequence of numbers, such as 1, 2, 3, 4 ... with line breaks.)
Then I connected the Arduino UNO and Bluetooth Mate with some wires and got it successfully paired with a Mac.
When I run this line on iTerm, I get only a sequence of question marks.
$ sudo cu -s 115200 -l /dev/tty.name-of-port
Connected.
??????????????????????????????
I also tried screen /dev/tty.name-of-porteither the Arduino console, but the result is still the same.
?
.