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:
- 14:000be67805b2
- Parent:
- 13:61c50db20069
- Child:
- 15:b77dc649e4f3
--- a/source/main.cpp Tue Jan 13 17:11:13 2015 +0000 +++ b/source/main.cpp Tue Jan 13 18:47:33 2015 +0000 @@ -10,8 +10,8 @@ //test de commit -//Serial uart(PTD3, PTD2); //xbee -Serial uart(USBTX, USBRX); //port série usb ACM0 +Serial uart(PTD3, PTD2); //xbee +//Serial uart(USBTX, USBRX); //port série usb ACM0 Servo servo(PTD0); AnalogIn pot1(PTC1); @@ -33,7 +33,7 @@ readline(); passebas(); - derivation(); + //derivation(); uart.printf("S");//debug START for (int indice_pixel=0; indice_pixel<128; indice_pixel++) @@ -49,16 +49,16 @@ max_detect=j; } } - // Réduction de la vitesse moteur si l'angle du servo augmente + // Réduction proportionelle de la vitesse moteur si l'angle du servo augmente if (max_detect>64) { - consigne_moteur_1=6-(max_detect-64)/20.; - consigne_moteur_2=6-(max_detect-64)/15.; + consigne_moteur_1=7*(1-(max_detect-64)/20.); + consigne_moteur_2=7*(1-(max_detect-64)/15.); } else { - consigne_moteur_1=6-(64-max_detect)/15.; - consigne_moteur_2=6-(64-max_detect)/20.; + consigne_moteur_1=7*(1-(64-max_detect)/15.); + consigne_moteur_2=7*(1-(64-max_detect)/20.); } // Lecture du potentiometre Kp_servo=2.0*pot1.read_u16()/65000.0;