Beispiel #1
0
void device_boot_msg(void)
{
  uint8_t ctr;

  for(ctr=0;ctr<3;ctr++)
  {
    LED1_BLINK();
    while(led_blink)               // wait until LED released...
      ;
    delay_10ms();

    LED2_BLINK();
    while(led_blink)               // wait until LED released...
      ;
    delay_10ms();

    LED3_BLINK();
    while(led_blink)               // wait until LED released...
      ;
    delay_10ms();

    LED2_BLINK();
    while(led_blink)               // wait until LED released...
      ;
    delay_10ms();

    LED1_BLINK();
    while(led_blink)               // wait until LED released...
      ;
    delay_10ms();

  }
}
Beispiel #2
0
void device_ptx_mode_esb(void)
{
  while(true)
  {
    // Wait til the packet is sent
    do {
      radio_irq ();
    } while((radio_get_status ()) == RF_BUSY);

    // Blink LED2 if ACK is recieved, LED3 if not
    if (((radio_get_status ()) == RF_TX_DS))
    {
      LED2_BLINK();
    }
    else
    {
      LED3_BLINK();
    }

    // Sleep 100ms
    start_timer(100);
    wait_for_timer();

    // Set up the payload according to the input button 1
    pload_esb[0] = 0;

    if(B1_PRESSED())
    {
      pload_esb[0] = 1;
    }

    //Send the packet
    radio_send_packet(pload_esb, RF_PAYLOAD_LENGTH);           
  }
}