ECE 4180 Lab 2 Part 7

Dependencies:   mbed

Committer:
abraha2d
Date:
Tue Oct 09 00:49:51 2018 +0000
Revision:
0:40a62a63d5b7
Save point

Who changed what in which revision?

UserRevisionLine numberNew contents of line
abraha2d 0:40a62a63d5b7 1 #include "mbed.h"
abraha2d 0:40a62a63d5b7 2
abraha2d 0:40a62a63d5b7 3 PwmOut mymot(p21);
abraha2d 0:40a62a63d5b7 4
abraha2d 0:40a62a63d5b7 5 int main()
abraha2d 0:40a62a63d5b7 6 {
abraha2d 0:40a62a63d5b7 7 while (1) {
abraha2d 0:40a62a63d5b7 8 for (float i = 0.0; i < 1.0; i += 0.02) {
abraha2d 0:40a62a63d5b7 9 mymot = i;
abraha2d 0:40a62a63d5b7 10 wait(0.05);
abraha2d 0:40a62a63d5b7 11 }
abraha2d 0:40a62a63d5b7 12 for (float i = 1.0; i > 0.0; i -= 0.02) {
abraha2d 0:40a62a63d5b7 13 mymot = i;
abraha2d 0:40a62a63d5b7 14 wait(0.05);
abraha2d 0:40a62a63d5b7 15 }
abraha2d 0:40a62a63d5b7 16 }
abraha2d 0:40a62a63d5b7 17 }