Program the control the fischertechnik robo interface or intelligent interface via tcp socket or via a java gui.
Diff: apps.cpp
- Revision:
- 0:7f26f0680202
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/apps.cpp Fri Dec 31 14:01:14 2010 +0000 @@ -0,0 +1,47 @@ +#include "mbed.h" +#include "EthernetNetIf.h" +#include "HTTPServer.h" + +extern EthernetNetIf eth; +HTTPServer svr; +LocalFileSystem fs("webfs"); +DigitalOut *leds[4]; +extern Serial viaUsb; + +void walking_lights() { + leds[0] = new DigitalOut(LED1); + leds[1] = new DigitalOut(LED2); + leds[2] = new DigitalOut(LED3); + leds[3] = new DigitalOut(LED4); + int i = 0; + while (1) { + *leds[i] = 1; + wait(0.2); + *leds[i] = 0; + i++; + i %= 4; + viaUsb.putc('*'); + } +} + +int http_server() { + FSHandler::mount("/webfs", "/files"); //Mount /webfs path on /files web path + //FSHandler::mount("/webfs", "/"); //Mount /webfs path on web root path + + svr.addHandler<FSHandler>("/files"); +// svr.addHandler<SimpleHandler>("/"); //Default handler + svr.bind(80); + + viaUsb.printf("Listening for http requests...\n"); +/* + Timer tm; + tm.start(); + //Listen indefinitely + while (true) { + Net::poll(); + if (tm.read()>.5) { + tm.start(); + } + } + */ +}