potato

Dependencies:   mbed

Fork of analoghalls by N K

main.cpp

Committer:
bwang
Date:
2015-02-21
Revision:
1:70eed554399b
Parent:
0:9753f3c2e5ca
Child:
2:b5c19d4eddcc

File content as of revision 1:70eed554399b:

#include "mbed.h"
#include "constants.h"
#include "shared.h"
#include "util.h"
#include "math.h"
#include "isr.h"

Serial pc(SERIAL_TX, SERIAL_RX);

PwmOut pha(_PH_A);
PwmOut phb(_PH_B);
PwmOut phc(_PH_C);

DigitalOut en(_EN);

AnalogIn throttle(_THROTTLE);
AnalogIn analoga(_ANALOGA);
AnalogIn analogb(_ANALOGB);

Motor* motor;

Ticker dtc_upd_ticker, throttle_upd_ticker;

float throttle_read;

int main() {
    en = 1;
    
    initTimers();
    initPins();
    initData();
    
    while(1) {
        throttle_read = throttle;
        pos_update();
    }
}