void receiverMain() {
    int i;
    char offset;
    char status;

    //doCycle();
    //doOscillate();

    nrf_init();
    delay();

    nrf_rxmode();
    delay();

    Delay10KTCYx(100);

    offset = 0;
    STATUS_LED = 0;
    while(1) {
        //STATUS_LED =
        nrf_receive(&rx_buf);

        updateBuffer();
        updateLEDs();
    }
}
Exemple #2
0
void slaveMain() {
    //slave
    int i;
    char offset;
    char status;

    nrf_init();
    delay();

    nrf_rxmode();
    delay();

//    while(1) {
//        LED_GREEN = nrf_recieve(&tx_buf, &rx_buf);
//    }

    nrf_setTxAddr(0);
    nrf_setRxAddr(0, 0);

    rx_buf[0] = 0;
    while(rx_buf[0] != 0x42) {
        nrf_recieve(&tx_buf, &rx_buf);
    }
    
    nrf_setTxAddr(rx_buf[1]);
    nrf_setRxAddr(0, rx_buf[1]);
    while(1) {
        LED_GREEN = nrf_recieve(&tx_buf, &rx_buf);
    }
}