However, I have the feeling that the digital pins 0 (RX) and 1 (TX) are not connected to any port of the mbot. Any help from other users or the Makeblock team?
I finally manage to establish a serial connection between the raspberry pi and the mbot.
Since the mbot serial port D0/D1 seems to be not connected to the mbot ports, I have used a software serial port (https://www.arduino.cc/en/Tutorial/TwoPortReceive). This works finally…
@makeblock: This seems to be another example of bad support…
You think you could provide a bit more details on how you achieved this, for noobies like me? I have a pi model b+ and would like to be able to connect the two.
The problem with the mbot is that the pins Tx and Rx (D0 and D1) are not connected to the ports. Therefore, I have used a software emulation of a second serial port: https://www.arduino.cc/en/Tutorial/TwoPortReceive
I use the makeblock RPI shield http://www.makeblock.cc/me-shield-for-raspberry-pi/ to connect both devices. However, it seems that the power supply of the mbot does not manage to power the raspberry pi, so I need an extra power supply for the pi.
Below is some example code for the arduino. Connect the pi and the mbot (e.g. using the makeblock RPI shield, mbot port 3) and start minicom the th pi:
minicom -b 9600 -o -D /dev/ttyAMA0
I hope this helps.
Good luck!
/* read US sensor on port3 and write the results to software serial port */
#include <MBot.h>
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>
// port2 of mbot
SoftwareSerial serialPort(10, 9);
MeUltrasonicSensor ultraSensor(PORT_3);
void setup(){
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
serialPort.begin(9600);
}
void loop(){
serialPort.print(ultraSensor.distanceCm());
serialPort.println(" cm");
delay(100);
}