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.
Diff: main.cpp
- Revision:
- 6:61fc60bf0f01
- Parent:
- 5:f6be64b76f98
diff -r f6be64b76f98 -r 61fc60bf0f01 main.cpp
--- a/main.cpp Mon Feb 25 11:42:29 2019 +0000
+++ b/main.cpp Mon Feb 25 12:50:24 2019 +0000
@@ -13,7 +13,11 @@
Serial command(USBTX, USBRX);
-PwmOut myservo1(PB_4);
+PwmOut myservo1(PB_3);
+PwmOut myservo2(PB_4);
+PwmOut myservo3(PA_9);
+PwmOut myservo4(PB_10);
+
/*INGRESE L A CONFIGURACION DE LOS MOTORES*/
#define INITCMD 0xFF
@@ -75,17 +79,16 @@
tip: deben pasar grados a microsegundo */
//fghgfhfgdhfdghfghg
-// dpulse=degrees2usec(grados);
-// myservo1.pulsewidth_us(dpulse);
+ dpulse=degrees2usec(grados);
+ myservo1.pulsewidth_us(dpulse);
}
-
uint32_t degrees2usec(uint8_t grados){
// Retorno el valor en usegundos, donde
// y − y1 = m(x − x1 )
if(grados <= DEGREES_MAX)
- return int(750+grados*1900/180);// u6
- return 750;
+ return int(500+grados*2400/180);// u6
+ return 500;
}
\ No newline at end of file