Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface Servo mbed-rtos mbed
Diff: main.cpp
- Revision:
- 2:f3e4edf4d638
- Parent:
- 1:7b6dd8cc286d
- Child:
- 3:269f1844a464
--- a/main.cpp Thu Dec 14 05:02:37 2017 +0000 +++ b/main.cpp Thu Dec 14 05:11:38 2017 +0000 @@ -1,5 +1,6 @@ #include "mbed.h" #include "EthernetInterface.h" +#include "Servo.h" #include <string.h> #define POS_CENTRO 1750 @@ -25,7 +26,7 @@ Mutex m_ref; unsigned int dist; -//Servo Servo1(D6); +Servo Servo1(D6); void tcp_server_thread (); void udp_broadcast (); @@ -37,7 +38,7 @@ eth.init(); eth.connect(); - //Servo1.Enable(POS_CENTRO,20000); + Servo1.Enable(POS_CENTRO,20000); // inicializa threads tcp_server.start(tcp_server_thread); broadcast.start(udp_broadcast); @@ -102,6 +103,7 @@ //client.send_all(buffer, n); // if (n <= 0) break; memset(buffer,0,256); + Servo1.SetPosition(sizeof(buffer)); } }