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.
Hello everyone,
I am trying to connect two mbeds through ethernet. Connections are:
The first mbed code is:
#include "mbed.h" Serial pc(USBTX, USBRX); // tx, rx Ethernet eth; int main() { pc.baud(115200); wait(1); pc.printf("Press any key to start...\r\n"); pc.getc(); // wait for keyboard while(1) { char buf = 0x20; pc.printf("Value to send = %d\n", buf); eth.write(&buf, 1); wait(5); } }The second mbed code is
#include "mbed.h" Serial pc(USBTX, USBRX); // tx, rx Ethernet eth; int main() { pc.baud(115200); wait(1); char buf; while(1) { int size = eth.receive(); if(size > 0) { eth.read(&buf, 1); printf("Destination: %02X\n", buf); } wait(1); } }Is there something wrong with these connections or the code? I cannot get a reply from the second mbed.