Академический Документы
Профессиональный Документы
Культура Документы
/****************************************************************************
Function
LightTargetLED
Parameters
uint8_t LED, the 8 bits number stands the LED status
Returns
nothing
Description
Light LEDs according to the input
Note: BIT6-4 for Red target LEDs, BIT3-1 for Green target LEDs, BIT7&0
are not used
Final Edit: Dongao Yang 11/25/14
****************************************************************************/
void LightTargetLED(uint8_t LED)
{
// for loop 8 times
for (int i=0; i<8; i++)
{
// write data pin to the number of the last digit of LED input
write(TargetLEDport,TargetLEDDataPin, (LED & BIT0HI));
// pulse SCK
pulse(TargetLEDport,TargetLEDSCKPin);
// shift LED input to right by 1 digit
LED = (LED>>1);
}
// pulse RCK
pulse(TargetLEDport,TargetLEDRCKPin);
}
/****************************************************************************
Function
VibrationOn
Parameters
nothing
Returns
nothing
Description
turn on the vibration motor
Final Edit: Dongao Yang 11/25/14
****************************************************************************/
void VibrationOn(void)
{
//write vibration control pin to high
write(VibrationPort, VibrationIO, 1);
}
/****************************************************************************
Function
VibrationOff
Parameters
nothing
Returns
nothing
Description
turn off the vibration motor
Final Edit: Dongao Yang 11/25/14
****************************************************************************/
void VibrationOff(void)
{
//write vibration control pin to low
write(VibrationPort, VibrationIO, 0);
}