Alyson Castiblanco
/
PARQUEADERO_VERTICAL
Codigo donde falta la comunicacion serial
Diff: mover.cpp
- Revision:
- 5:342e6640b61e
- Parent:
- 4:66f0a55f249d
--- a/mover.cpp Fri Sep 07 12:38:06 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ - -#include "mover.h" -#include "mbed.h" -#include "math.h" - - -PwmOut myServo1(PB_3); -PwmOut myServo2(PB_4); -PwmOut myServo3(PB_5); - - -uint8_t ss_time=50; // tiempo de espera para moverse 1 mm en microsegundos - -void put_sstime(uint8_t vtime){ - ss_time=vtime; - -} - -int coord2us(float coord) -{ - if(0 <= coord <= MAXPOS) - return int(750+coord*1900/50);// u6 - return 750; - -} - - - - - -void mover_ser(uint8_t motor, uint8_t pos){ - - int pulseX = coord2us(pos); - - myServo1.pulsewidth_us(pulseX); - - -} - -void init_servo() -{ - myServo1.period_ms(20); - myServo2.period_ms(20); - myServo3.period_ms(20); - - -} \ No newline at end of file