ECE 4180 Lab 2 Part 6

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 mymot(p20);
00004 
00005 int main()
00006 {
00007     while(1) {
00008         for (int i = 0; i < 2; i++) {
00009             mymot = 1;
00010             wait(0.2);
00011             mymot = 0;
00012             wait(0.2);
00013         }
00014         for (int i = 0; i < 4; i++) {
00015             mymot = 1;
00016             wait(0.1);
00017             mymot = 0;
00018             wait(0.1);
00019         }
00020     }
00021 }