
Lol smth
Dependencies: LocalPositionSystem MMA8451Q Motor_Driver Sensors mbed
Fork of TDP_main_BartFork by
main.cpp
- Committer:
- Joseph_Penikis
- Date:
- 2015-02-22
- Revision:
- 6:bea13722aae7
- Parent:
- 5:2fc7bf0135d4
- Child:
- 7:14af656b721f
File content as of revision 6:bea13722aae7:
// TESTING REPO COMMIT /* ****** MAIN PROGRAM ****** TODO : organisational routine still to be decided. 3 main approaches: -sequential prirority based tasks -Timer/Ticker driven with sequential prirority based tasks - interrupt driven from sensor inputs Please consider that although it is an embedded envrionment we are NOT creating a HARD-TIME real time system - delays can be dealt with */ #include "mbed.h" #include "sensor_measure.h" #include "Motor_Driver.h" #define PWM_PERIOD_US 10000 // Pulses sets how many edges to detect before returning a time, max of 2^16, affectively refers to sample time // Clock divider set by prescalar function where division value is 2^n extern "C" void setup(int pulses, int prescalar); int main() { /* Motor_Driver motors(PTD4, PTA12, PTA4, PTA5, PTC9, PTC8, PWM_PERIOD_US); motors.setSpeed(1.0f); motors.forward(); motors.start(); wait(3); motors.stop() motors.reverse(); wait(200ms); motors.start(); */ setup(1000, 0); sensor_initialise(); // initialise sensor values wait(1); //give time to set up the system }