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 // Output LEDs 00033 //DigitalOut led_rtcOutput(); // No need as RTC has led output 00034 //DigitalOut led_emergencyBrake(PE_11); 00035 DigitalOut led_parkMode(PF_10); 00036 00037 00038 //Motor outputs // ENSURE YOU USE DAC PINS - BOTH MOTORS SHARE PINS 00039 AnalogOut motorAccelerator(PA_5); 00040 AnalogOut motorBrake(PA_4); 00041 00042 ////motor 1 settings 00043 DigitalOut keySwitchM1(PF_1); 00044 DigitalOut directionFwd(PF_0); 00045 DigitalOut directionRev(PD_1); 00046 //DigitalOut directionM1(PA_3); // FORWARD AND REVERSE NEED TO BE SEPARATE 00047 DigitalOut footswitchM1(PD_4); 00048 DigitalOut seatM1(PD_5); 00049 DigitalOut inchFwdM1(PD_6); 00050 DigitalOut speedLimit2M1(PD_7); 00051 DigitalOut speedLimit3M1(PE_3); 00052 00053 ////motor 2 settings; 00054 //DigitalOut keySwitchM2(PD_10); 00055 //DigitalOut directionM2(PG_6); 00056 //DigitalOut footswitchM2(PG_4); 00057 //DigitalOut seatM2(PC_8); 00058 //DigitalOut inchFwdM2(PC_6); 00059 //DigitalOut speedLimit2M2(PA_12); 00060 //DigitalOut speedLimit3M2(PA_11); 00061 00062 DigitalIn superCapPreCharge(PB_11); // Supercaps are pre-charged 00063 DigitalIn superCapVoltage(PB_2); // Supercaps are Full 00064 00065 //Contactors as digital outputs 00066 DigitalOut contactBatt(PE_8); // C-BAT 00067 DigitalOut contactCompressor(PG_10); // C-COM 00068 DigitalOut contactCapCharge(PG_11); // C-CHA 00069 00070 //DigitalOut contactMtr1(PE_0); // DRIVEN BY MOTOR CONTROLLER 00071 //DigitalOut contactMtr2(PG_8); 00072 00073 //mechanical braking and other air components. 00074 DigitalOut brakeValve32(PD_3); //wire 90 - back brake pin 00075 DigitalOut brakeValve22(PC_0); //wire 91 - front brake pin 00076 DigitalOut whistleValve32(PG_15); 00077 00078 DigitalIn pressureSwitch1(PC_13, PullUp); 00079 DigitalIn pressureSwitch2(PC_1, PullUp); 00080 DigitalIn pressureSwitch3(PC_15, PullUp); 00081 //DigitalIn brakePressure(PH_0); // NOT INSTALLED 00082 DigitalIn mainlinePressure(PH_1, PullUp); 00083 00084 //Lights 00085 DigitalOut FrontLight(PE_12); 00086 DigitalOut BackLight(PE_14); 00087 DigitalOut BeaconLight(PE_15);
Generated on Thu Jul 28 2022 02:21:05 by
