Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hey guys, I'm having trouble getting my mbed to send ints to my arduino mega. I set up a simple code on the mbed:
#include "mbed.h" Serial duino(p28, p27); Serial pc(USBTX, USBRX); Timer timer; int main() { pc.baud(115200); duino.baud(9600); pc.printf("Starting...\n\r"); timer.start(); while (1) { if (timer.read() > 1) { pc.printf("Writing!\n\r"); duino.putc(4); timer.reset(); } } }The code on the arduino is just looking for this incoming data:
void setup() { Serial.begin(115200); Serial2.begin(9600); Serial.println("Starting..."); } void loop() { if(Serial2.available() > 0){ Serial.print("Got something! "); Serial.println(Serial2.read(),DEC); } }The arduino sits there and doesn't seem to receive anything. I also tried printf("4") also with no success (probably as expected...). Anybody have any idea what the problem is? I successfully implemented SPI comm between the mbed (slave) and arduino (master), I don't know why this is giving me problems...
Thanks!