Beispiel #1
0
void channelhop()
{ 

 uint8_t channel;
 
 while (1)
 {
	 
 
 for (channel = 11;channel <25;channel++)
 {
  lib_sleep_thread(1000);
 lib_radio_set_channel(channel); 
  
 lib_radio_send_string("Hello, world!\n"); 
 lib_yellow_toggle();
  
 }
 
 } 
 channel = 21; 
 lib_radio_set_channel(channel); 
 return; 

}
Beispiel #2
0
void threadC()
{
    while (1)
	{
        lib_sleep_thread(5000);
        //lib_red_toggle();
        lib_post_real_time_user_task(compTaskC, 5000);
    }
  
  return; 
}
Beispiel #3
0
void threadB()
{
    while (1)
	{
        lib_sleep_thread(2000);
        //lib_green_toggle();
        lib_post_real_time_user_task(compTaskB, 2000);
    }
  
  return; 
}
Beispiel #4
0
void threadA()
{
    while (1)
	{
        lib_sleep_thread(1000);
        //lib_yellow_toggle();
        lib_post_real_time_user_task(compTaskA, 1000);
    }
  
  return; 
}
Beispiel #5
0
void blink()
{
	while (1)
	{
   lib_sleep_thread(500);  
   lib_red_toggle();
   
   counter++; 
  }
  
  return; 
}
void testcounter()
{



    uint8_t ledcounter;
    counter = 0;




    while (1)
    {

        lib_sleep_thread(500);

        buffersum[0] = getNodeID();

        lib_get_radio_lock();
        lib_radio_set_channel(19);
        buffersum[1] = counter;
        lib_radio_send_msg(0xffff, 0xffff, 8, (uint8_t *)buffersum);
        lib_release_radio_lock();
        counter++;


        if (counter&0x1)
            lib_red_on();
        else
            lib_red_off();

        if (counter&0x2)
            lib_green_on();
        else
            lib_green_off();

        if (counter&0x04)
            lib_yellow_on();
        else
            lib_yellow_off();

    }

    return;
}