Other Parts Discussed in Thread: Z-STACK
Hello,
How can I program the CC2530 to make a motor run forever until HAL_KEY_SW_1 is presssed. I have it so that I press HAL_KEY_SW_6 (in HandleKeys) to start to motor. Below is my code so far in SampleLight, but the CC2530 is skipping over the while loop. My program is supposed to say that if HAL_KEY_SW_1 isn't pressed, run the motor until the button is pressed. Why doesn't it work?
static void zclSampleLight_DisplayLight( void )
{
// set the LED1 based on light (on or off)
if ( zclSampleLight_OnOff == LIGHT_ON & no == 0 )
{
while(!HAL_KEY_SW_1){
DATA_PIN = 0;
forward = 0;
backward = 1;
for(int i=0; i<time; i++){
Onboard_wait(10000);
}
}
forward = 0;
backward = 0;
DATA_PIN = 1;
no = 1;
}
