mbed school / Mbed 2 deprecated mbed_DCMotor_Control

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut ledForPower1(LED1);
00004 DigitalOut ledForPower2(LED2);
00005 DigitalOut ledForPower3(LED3);
00006 DigitalOut ledForPower4(LED4);
00007 PwmOut motor(p21);
00008 
00009 int main() {
00010 
00011         motor=0;
00012         wait(2);
00013 
00014         motor=0.4;
00015         ledForPower1=1;
00016         wait(2);
00017 
00018         motor=0.6;
00019         ledForPower2=1;
00020         wait(2);
00021 
00022         motor=0.8;
00023         ledForPower3=1;
00024         wait(2);
00025 
00026         motor=1;
00027         ledForPower4=1;
00028 
00029 }