4180 Lab 2

Dependencies:   mbed wave_player Servo 4DGL-uLCD-SE Motor SDFileSystem LSM9DS1_Library_cal PinDetect X_NUCLEO_53L0A1

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers part10.h Source File

part10.h

00001 #include "mbed.h"
00002 #include "Motor.h"
00003 
00004 AnalogIn pot(p9);
00005 Motor motor(p10, p11, p12);
00006 
00007 int run_part10() {
00008     while(1) {
00009         float ctrl = (pot * 2) - 1.0;
00010         
00011         motor.speed(ctrl);
00012         
00013         wait(0.1);
00014     }
00015 }