summaryrefslogtreecommitdiff
path: root/client/client.c
blob: a6d51bd28fda230358ebdf058151853074be9904 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#define F_CPU 1000000UL

#include <util/delay.h>
#include <nrf24l01.h>

int main(void)
{
  uint8_t status;

  nrf24l01_init();
  nrf24l01_power_up();
  nrf24l01_receive_mode();

  while(1) {
    if(is_data_received()) {
      nrf24l01_receive_byte();

      status = nrf24l01_read_reg(NRF24L01_REG_STATUS);
      nrf24l01_write_reg(NRF24L01_REG_STATUS, status);
    }
    _delay_us(100000);
  }

  return 0;
}