Eimantas Bernotavicius / Mbed 2 deprecated Buggy_Project

Dependencies:   QEI mbed

pins.cpp

Committer:
Weranest
Date:
2018-02-22
Revision:
4:48d390356fba
Parent:
3:c9df852ad9ac

File content as of revision 4:48d390356fba:

//This file is strictly to define pins for buggy operations. Thats it. But thought it would be easier to overseer them like this
#include "mbed.h"
#include "C12832.h"
#include "pins.h"
#include "QEI.h"
#include "constants.cpp"
#include "C12832.h"
//Encoder pins (created as a QEI object, so just defined naming for pins)
//=======================
#define channelARight PB_1
#define channelBRight PC_4
#define channelIRight PC_5
#define channelALeft PC_2
#define channelBLeft PC_3
#define channelILeft PC_6
QEI encoderRight(channelARight, channelBRight, channelIRight, ENCODER_PULSE);
QEI encoderLeft(channelALeft, channelBLeft, channelILeft, ENCODER_PULSE);
//Motor control pins
//=======================
PwmOut motorRight(PB_7);
PwmOut motorLeft(PC_8);
DigitalOut motorDirRight(PH_0);
DigitalOut motorDirLeft(PB_5);
DigitalOut motorModeRight(PC_15);
DigitalOut motorModeLeft(PB_4);
DigitalOut driveBoard (PB_2);
//Line sensor pins
//=======================
//UI pins(setup for control)
//=======================
C12832 lcd(D11, D13, D12, D7, D10);
AnalogIn potentiometerLeft(PA_1);
AnalogIn potentiometerRight(PA_0);
DigitalIn joystickCentre(PB_10);
DigitalIn joystickDown(PB_0);
//Magnet sensor pins
//=======================