this program can by compiled and run on several mbeds in a network. The mbed ID is automatically generated. This program is a small test to see if it works. To test the firmware you will need two ( or more ) mbed modules connected to the same network. Pin p5 should be connected with a push button to 3v3 and a resistor of 10k to ground. If the button is pressed the mbed will broadcast a message on ip 239, 192, 1, 100 on port 50000. All mbeds are listening to this ip address and port so they will pick up this message. If the message says MBED xyz LED ON, led1 will id on. If the message says MBED LED OFF, led1 will be off. It\\\'s that simple. So with one mbed you can turn the other mbeds led on or off.
Dependencies: EthernetNetIf NTPClient_NetServices mbed
Diff: system.h
- Revision:
- 3:3c33a398189e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/system.h Mon Feb 14 08:10:14 2011 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "EthernetNetIf.h" +#include "UDPSocket.h" +#include "NTPClient.h" + +Serial pc(USBTX, USBRX); +EthernetNetIf eth; +NTPClient ntp; +UDPSocket udp; +DigitalOut led(LED1); +InterruptIn button(p5); +Ticker AliveTicker; + +struct tm *cTime; // Stucture that holds the current time + +// Message to let the other know we are alive +char strAlive[15]; + +char mebed_list[16]; + +char ButtonPressed = 0; +char SendAlive = 0; +char mbed_id = 0; +char mbed_client = 0;