video streaming using websocket. but,streaming is very slower than 0.1fps.
Dependencies: BaseUsbHost EthernetInterface WebSocketClient mbed-rtos mbed
Fork of BaseUsbHost_example by
Diff: example1_UsbMouseHost.cpp
- Revision:
- 0:2a9734a95d55
- Child:
- 1:80205a2de336
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example1_UsbMouseHost.cpp Tue Dec 04 13:39:57 2012 +0000 @@ -0,0 +1,54 @@ +#if 0 +#include "mbed.h" +#include "rtos.h" +#include "BaseUsbHost.h" +#define DEBUG +#include "BaseUsbHostDebug.h" +#define TEST +#include "BaseUsbHostTest.h" +#include "UsbMouseHost.h" + +Serial pc(USBTX, USBRX); +DigitalOut led1(LED1); + +BaseUsbHost *UsbHost; +UsbHub* hub; +ControlEp* ctlEp = NULL; +UsbMouseHost* mouse; +int main() { + pc.baud(921600); + printf("%s\n", __FILE__); + + UsbHost = new BaseUsbHost; + TEST_ASSERT_TRUE(UsbHost); + + UsbHub* hub = new UsbHub(); + TEST_ASSERT_TRUE(hub); + + for(int i = 0; i < 4; i++) { + ctlEp = hub->PortEp[i]; + if (ctlEp) { + break; + } + } + + mouse = new UsbMouseHost(ctlEp); + TEST_ASSERT(mouse); + + + while(1) { + uint32_t status; + int r = mouse->read(&status); + if (r == USB_OK) { + printf("%08X\n", status); + if (status & 1) { // left + led1 = !led1; + } else if (status & 2) { // right + break; + } + } + } + exit(1); +} + +#endif