
This project will enable remote control of a motorised turntable via a WiFi enabled TCP link using ACKme's (http://ack.me/) Wi-Fi enablement platform
Revision 0:01fd80c0a524, committed 2014-08-26
- Comitter:
- Stathisn
- Date:
- Tue Aug 26 05:04:24 2014 +0000
- Child:
- 1:7b420a2ea7db
- Commit message:
- Initial commit, added place holders for some functions pertaining to the initialisation and calibration of the turntable
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Aug 26 05:04:24 2014 +0000 @@ -0,0 +1,48 @@ +#include "mbed.h" + +enum calib_state_t { + UNCALIBRATED, + CALIBRATED, + CALIBRATING, + INITIALISING,}; + +DigitalOut my_led(LED1); // Sanity LED +DigitalOut ttDrive(PA_14); // the drive signal for the turntable +InterruptIn encoder(PA_13); // Signal from encoder +InterruptIn limitSwitch(PA_15); // Signal from limit switch + +calib_state_t calib_state = 0; // Flag for calibration state +int encoderMax = 0; // Calibrated maximum value for the encoder + +void calibrate(void); // synchronises and calibrates MCU to turntable +void increment(int *i); // increments value i, used as an interrupt target + + +int main() { + + + // Step 1: Attach interrupt signals to appropriate functions + // Step 2: Calibrate MCU to the turn table + // Step 3: Control turntable using hard coded commands + // Step 4: Include WiConnect Library + // Step 5: Interpret commands sent over TCP + + + // Configure sanity LED to blink + while(1) { + my_led = !my_led; + wait(0.5); + } +} + +void calibrate(void) +{ + // Step 1: Get the motor turning + // Step 2: Continue turning until calibration state is "CALIBRATED" + // the actual calibration will be handled by interrupts +} + +void increment(int *i) +{ + // Step 1: De-refference pointer and increment the value +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Aug 26 05:04:24 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013 \ No newline at end of file