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

Committer:
Schueler
Date:
Mon Feb 14 08:10:14 2011 +0000
Revision:
3:3c33a398189e
1.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Schueler 3:3c33a398189e 1 #include "mbed.h"
Schueler 3:3c33a398189e 2 #include "EthernetNetIf.h"
Schueler 3:3c33a398189e 3 #include "UDPSocket.h"
Schueler 3:3c33a398189e 4 #include "NTPClient.h"
Schueler 3:3c33a398189e 5
Schueler 3:3c33a398189e 6 Serial pc(USBTX, USBRX);
Schueler 3:3c33a398189e 7 EthernetNetIf eth;
Schueler 3:3c33a398189e 8 NTPClient ntp;
Schueler 3:3c33a398189e 9 UDPSocket udp;
Schueler 3:3c33a398189e 10 DigitalOut led(LED1);
Schueler 3:3c33a398189e 11 InterruptIn button(p5);
Schueler 3:3c33a398189e 12 Ticker AliveTicker;
Schueler 3:3c33a398189e 13
Schueler 3:3c33a398189e 14 struct tm *cTime; // Stucture that holds the current time
Schueler 3:3c33a398189e 15
Schueler 3:3c33a398189e 16 // Message to let the other know we are alive
Schueler 3:3c33a398189e 17 char strAlive[15];
Schueler 3:3c33a398189e 18
Schueler 3:3c33a398189e 19 char mebed_list[16];
Schueler 3:3c33a398189e 20
Schueler 3:3c33a398189e 21 char ButtonPressed = 0;
Schueler 3:3c33a398189e 22 char SendAlive = 0;
Schueler 3:3c33a398189e 23 char mbed_id = 0;
Schueler 3:3c33a398189e 24 char mbed_client = 0;