MotorPIC
(On Motor Driving PIC)
Function: Main()
Initialize Pins,PWM,and SPI communication
Keep checking if all 3bytes have been received using DataReceived flag
Figure out if we are zombie, if yes, call ZombieConvert() followed by HumanMode()
else call HumanMode();
call setPWM()
End
Function:Interrupt ISR()
Checks if 3 bytes have been received, if not , keeps storing,
else sets DataReceived flag high
End
Function: ZombieConvert()
Set the speedData and DirnData to appropriate values depending on the message from necromancer
End
Function: HumanMode()
Use DirnData, SpeedData and FlagData to determine Direction and brake pin values for the propeller driver boards.
End
Function: setPWM()
Use the speedbyte to set PWM
use the Dirnpins to set Direction and Brake values.
End
Initialize Pins,PWM,and SPI communication
Keep checking if all 3bytes have been received using DataReceived flag
Figure out if we are zombie, if yes, call ZombieConvert() followed by HumanMode()
else call HumanMode();
call setPWM()
End
Function:Interrupt ISR()
Checks if 3 bytes have been received, if not , keeps storing,
else sets DataReceived flag high
End
Function: ZombieConvert()
Set the speedData and DirnData to appropriate values depending on the message from necromancer
End
Function: HumanMode()
Use DirnData, SpeedData and FlagData to determine Direction and brake pin values for the propeller driver boards.
End
Function: setPWM()
Use the speedbyte to set PWM
use the Dirnpins to set Direction and Brake values.
End