Giro en su propio eje Presentado por: Julio Fajardo, Cesar Pacheco, Angel Trujillo, Daniel Vizcaya

Dependencies:   mbed

Fork of 01_Embebidos by Daniel Vizcaya

Revision:
6:87a37f4163bd
Parent:
3:3665eb7346e2
--- a/draw.cpp	Wed Mar 14 05:17:52 2018 +0000
+++ b/draw.cpp	Wed Apr 25 02:12:19 2018 +0000
@@ -5,9 +5,9 @@
 
 
 
-PwmOut myServoX(PB_3);
-PwmOut myServoY(PB_4);
-PwmOut myServoZ(PB_5);
+PwmOut myServoX(D3);
+PwmOut myServoY(D4);
+PwmOut myServoZ(D5);
 
 uint8_t  posx_old=0;     // posición anterior del eje X
 uint8_t  posy_old=0;     // posición anterior del eje Y
@@ -21,9 +21,8 @@
 int coord2us(float coord)
 {
     if(0 <= coord <= MAXPOS)
-        return int(750+coord*1900/50);// u6
-    return 750;
-
+        return int(coord*30+500);// u6
+    return 500;
 }
 
 void sstime(uint8_t x, uint8_t y)
@@ -37,6 +36,7 @@
     
  }
  
+ 
 void draw(){
 myServoZ.pulsewidth_us(POSDRAW);
 wait_ms(ss_time*2);