Table 3

Code variable and pin definitions for microcontrollers

VariableDefinitionPin
Part 1. Defined pins for main microcontroller
 redLED0LED 134
 grnLED0 36
 bluLED0 37
 redLED1LED 238
 grnLED1 40
 bluLED1 41
 redLED2LED 342
 grnLED2 44
 bluLED2 45
 redLED3LED 446
 grnLED3 48
 bluLED3 49
 redLED4LED 550
 grnLED4 52
 bluLED4 53
 dirPinStepper motor26
 pulPin 28
 interruptPin0Receives sensor 1 output3
 interruptPin1Receives sensor 2 output18
 interruptPin2Receives sensor 3 output19
 interruptPin3Receives sensor 4 output20
 interruptPin4Receives sensor 5 output21
 startButton1PinStart pushbutton24
 cycleButtonPinCycle pushbutton22
 interruptKillPinEmergency stop pushbutton2
 radiusPinToggle switch (for radius size)23
Part 2. Defined variables for main microcontroller (Arduino MEGA)
 startTimeRepresents time after ramping sequence begins 
 endTime0Time after mouse 1 falls 
 endTime1Time after mouse 2 falls 
 endTime2Time after mouse 3 falls 
 endTime3Time after mouse 4 falls 
 endTime4Time after mouse 5 falls 
 elapsedTimeProgressUsed to represent present time throughout the program (used for equations) 
 elapsedTime0Time mouse 1 spend on the rod from ramping program start to when it falls (endTime0-startTime) 
 elapsedTime1Time mouse 2 spend on the rod from ramping program start to when it falls (endTime0-startTime) 
 elapsedTime2Time mouse 3 spend on the rod from ramping program start to when it falls (endTime0-startTime) 
 elapsedTime3Time mouse 4 spend on the rod from ramping program start to when it falls (endTime0-startTime) 
 elapseedTime4Time mouse 5 spend on the rod from ramping program start to when it falls (endTime0-startTime) 
 modeVariable used to represent what ramping program (case) is selected 
 delayTMillisVariable for delay time between each impulse sent to stepper motor (in milliseconds) 
 delayTMicrosVariable for delay time between each impulse sent to stepper motor (in microseconds) 
 previousStateVariable for cycle button programming 
 startButtonStateStart button 
 mouse0FellVariable used for switch case logic 
 mouse1FellVariable used for switch case logic 
 mouse2FellVariable used for switch case logic 
 mouse3FellVariable used for switch case logic 
 mouse4FellVariable used for switch case logic 
 mouse0DoneVariable used for switch case logic 
 mouse1DoneVariable used for switch case logic 
 mouse2DoneVariable used for switch case logic 
 mouse3DoneVariable used for switch case logic 
 mouse4DoneVariable used for switch case logic 
 killButtonStateEmergency state button variable 
 radiusFactorUsed to adjust equations for rods of different diameter 
 radiusSwitchStateFor toggle switch logic 
 loopCountFor pushbutton logic 
Part 3. Defined pins and variables for secondary microcontroller (Arduino UNO)
 currentVolts0Calculated volts from sensor 1 based on raw data sent to microcontroller 
 currentVolts1Calculated volts from sensor 2 based on raw data sent to microcontroller 
 currentVolts2Calculated volts from sensor 3 based on raw data sent to microcontroller 
 currentVolts3Calculated volts from sensor 4 based on raw data sent to microcontroller 
 currentVolts4Calculated volts from sensor 5 based on raw data sent to microcontroller 
 previousVolts0Volts from previous data reading 
 previousVolts1Volts from previous data reading 
 previousVolts2Volts from previous data reading 
 previousVolts3Volts from previous data reading 
 previousVolts4Volts from previous data reading 
 newVolts0Volts from sensor 1 after passed through digital lowpass filter 
 newVolts1Volts from sensor 1 after passed through digital lowpass filter 
 newVolts2Volts from sensor 1 after passed through digital lowpass filter 
 newVolts3Volts from sensor 1 after passed through digital lowpass filter 
 newVolts4Volts from sensor 1 after passed through digital lowpass filter 
 aValue for digital low pass filter 
 pin 2Output for sensor 1 
 pin 3Output for sensor 2 
 pin 4Output for sensor 3 
 pin 5Output for sensor 4 
 pin 6Output for sensor 5