Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Sensornode_temp by
main.cpp
- Committer:
- Makodan
- Date:
- 2018-05-14
- Revision:
- 1:bd92b3ee97c1
- Parent:
- 0:49273053c399
File content as of revision 1:bd92b3ee97c1:
#include "mbed.h"
#include "config.h"
#include "RF24.h"
DigitalOut myled(ledpin);
RF24 radio(spi_MOSI, spi_MISO, spi_SCK, nrf_CE, nrf_CSN );
void RadioSetup();
int main(){
myled=1;
RadioSetup();
radio.stopListening();
wait_ms(1000);
myled=0;
int dummy = 1234;
while(1){
myled=1;
radio.write(&dummy, 4);
wait_ms(1000);
myled=0;
wait_ms(1000);
}
}
void RadioSetup(){
radio.begin();
radio.setPALevel(RF24_PA_MAX);
radio.setChannel(RadioChannel);
radio.setRetries(0,2);
radio.setDataRate(RF24_2MBPS);
radio.enableDynamicAck();
radio.enableDynamicPayloads();
radio.openWritingPipe(DataAddress);
}
