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
Revision 0:4e7abff23e4d, committed 2019-09-14
- Comitter:
- NeoLewis
- Date:
- Sat Sep 14 11:10:55 2019 +0000
- Commit message:
- 13/09
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Sep 14 11:10:55 2019 +0000 @@ -0,0 +1,30 @@ +#include "mbed.h" +//#include "Motor.h" + +#define MAX_PPM 2006 // Valor indicando que o motor deve ir para frente com 100% de acordo com o ppm +#define MED_PPM 1505 // Valor indicando que o motor deve ficar parado de acordo com o ppm +#define MIN_PPM 1003 // Valor indicando que o motor deve ir para tras com 100% de acordo com o ppm + +PwmOut LeftMotor(p25); //Definicao da porta do motor da esquerda +PwmOut RightMotor(p26); //Definicao da porta do motor da direita + +int main (void) +{ + + RightMotor.period_ms(16); + RightMotor.pulsewidth_us(MED_PPM); + + LeftMotor.period_ms(16); + LeftMotor.pulsewidth_us(MED_PPM); + wait(5); + + while(1) + { + wait(4900); + LeftMotor.pulsewidth_us(MAX_PPM); wait(0.01); + RightMotor.pulsewidth_us(MAX_PPM); wait(0.01); + } + + return 0; + +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Sep 14 11:10:55 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file