4180 Lab 2

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

part10.h

Committer:
emilywilson
Date:
2020-02-04
Revision:
2:de355b6fbd87
Parent:
1:6d8f645530b8

File content as of revision 2:de355b6fbd87:

#include "mbed.h"
#include "Motor.h"

AnalogIn pot(p9);
Motor motor(p10, p11, p12);

int run_part10() {
    while(1) {
        float ctrl = (pot * 2) - 1.0;
        
        motor.speed(ctrl);
        
        wait(0.1);
    }
}