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: mbed freescal_cup_k22f
Diff: source/main.cpp
- Revision:
- 9:43c8e6d6724d
- Parent:
- 8:8f886cd6a59f
- Child:
- 10:3424e7b66671
--- a/source/main.cpp Tue Jan 13 16:18:03 2015 +0000 +++ b/source/main.cpp Tue Jan 13 16:43:40 2015 +0000 @@ -10,9 +10,10 @@ //test de commit -Serial uart(PTD3, PTD2); +//Serial uart(PTD3, PTD2); //xbee +Serial uart(USBTX, USBRX); //port série usb ACM0 Servo servo(PTD0); - +AnalogIn pot1(PTC1); int main() { // Initialisation @@ -20,6 +21,7 @@ int indexMin=0; int indexMax=128; int max_detect=indexMin; + float Kp_servo = 0; uart.baud(115200); init_led(); @@ -31,6 +33,7 @@ readline(); passebas(); + derivation(); uart.printf("S");//debug START for (int indice_pixel=0; indice_pixel<128; indice_pixel++) @@ -48,6 +51,9 @@ } //servo = float(min_detect-indexMin)/float(indexMax-indexMin); + //lecture du potentiometre + Kp_servo=2.0*pot1.read_u16()/65000.0; + // servo = float(max_detect)/128.; }