Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
definitions.cpp
00001 #include <mbed.h> 00002 #include "definitions.h" 00003 00004 // COMMS DEFINITIONS 00005 Serial pc(USBTX, USBRX); 00006 00007 // INTERRUPTS 00008 InterruptIn rtc_output(PF_11, PullUp); 00009 InterruptIn autoStopTrigger(PD_2, PullDown); //interrupt on lineside equipment detection 00010 InterruptIn hallSensor(PG_3); // For Hall Sensor Tachometer 00011 00012 // PIN DEFINITIONS 00013 00014 // INNOVATION/ COLLISION DETECTION 00015 AnalogIn irSensor_1(PF_6); 00016 AnalogIn irSensor_2(PF_7); 00017 AnalogIn irSensor_3(PC_2); 00018 00019 //RTC individual inputs// 00020 DigitalIn rtc_1(PG_4, PullUp); 00021 DigitalIn rtc_2(PG_6, PullUp); 00022 DigitalIn rtc_3(PG_7, PullUp); 00023 DigitalIn rtc_4(PG_5, PullUp); 00024 DigitalIn rtc_5(PD_10, PullUp); 00025 DigitalIn rtc_6(PG_8, PullUp); 00026 DigitalIn rtc_7(PE_0, PullUp); 00027 DigitalIn rtc_override(PG_14, PullUp); 00028 00029 // RTC Outputs 00030 DigitalOut rtc_Trigger(PD_14); 00031 00032 00033 // Output LEDs 00034 //DigitalOut led_rtcOutput(); // No need as RTC has led output 00035 //DigitalOut led_emergencyBrake(PE_11); 00036 DigitalOut led_parkMode(PF_10); 00037 00038 00039 //Motor outputs // ENSURE YOU USE DAC PINS - BOTH MOTORS SHARE PINS 00040 AnalogOut motorAccelerator(PA_5); 00041 AnalogOut motorBrake(PA_4); 00042 00043 ////motor 1 settings 00044 DigitalOut keySwitchM1(PF_1); 00045 DigitalOut directionFwd(PF_0); 00046 DigitalOut directionRev(PD_1); 00047 //DigitalOut directionM1(PA_3); // FORWARD AND REVERSE NEED TO BE SEPARATE 00048 DigitalOut footswitchM1(PD_4); 00049 DigitalOut seatM1(PD_5); 00050 DigitalOut inchFwdM1(PD_6); 00051 DigitalOut speedLimit2M1(PD_7); 00052 DigitalOut speedLimit3M1(PE_3); 00053 00054 ////motor 2 settings; 00055 //DigitalOut keySwitchM2(PD_10); 00056 //DigitalOut directionM2(PG_6); 00057 //DigitalOut footswitchM2(PG_4); 00058 //DigitalOut seatM2(PC_8); 00059 //DigitalOut inchFwdM2(PC_6); 00060 //DigitalOut speedLimit2M2(PA_12); 00061 //DigitalOut speedLimit3M2(PA_11); 00062 00063 DigitalIn superCapPreCharge(PB_11); // Supercaps are pre-charged 00064 DigitalIn superCapVoltage(PB_2); // Supercaps are Full 00065 00066 //Contactors as digital outputs 00067 DigitalOut contactBatt(PE_8); // C-BAT 00068 DigitalOut contactCompressor(PG_10); // C-COM 00069 DigitalOut contactCapCharge(PG_11); // C-CHA 00070 00071 //DigitalOut contactMtr1(PE_0); // DRIVEN BY MOTOR CONTROLLER 00072 //DigitalOut contactMtr2(PG_8); 00073 00074 //mechanical braking and other air components. 00075 DigitalOut brakeValve32(PD_3); //brake pins updated wire 90 back brake 00076 DigitalOut brakeValve22(PC_0); // brake pins updated wire 91 front brake 00077 DigitalOut whistleValve32(PG_15); 00078 00079 DigitalIn pressureSwitch1(PC_13, PullUp); 00080 DigitalIn pressureSwitch2(PC_1, PullUp); 00081 DigitalIn pressureSwitch3(PC_15, PullUp); 00082 //DigitalIn brakePressure(PH_0); // NOT INSTALLED 00083 DigitalIn mainlinePressure(PH_1, PullUp); 00084 00085 ///Eergy Storage; 00086 00087 AnalogIn vref_powercab(PA_3); 00088 AnalogIn vref_supercap(PF_5); 00089 AnalogIn vout_powercab(PC_3); 00090 AnalogIn vout_supercap(PF_3); 00091 00092 ///Lights 00093 DigitalOut FrontLight(PB_14); 00094 DigitalOut BackLight(PB_15);
Generated on Tue Jul 19 2022 04:44:17 by
1.7.2