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 testuC by
main.cpp
00001 #include "mbed.h" 00002 #include "nRF24L01P.h" 00003 #define IWDG_START 0x0000CCCC 00004 #define IWDG_WRITE_ACCESS 0x00005555 00005 #define IWDG_PR_PR_0 7 00006 #define IWDG_RELOAD 200000 00007 #define IWDG_REFRESH 0xAAAA 00008 DigitalOut vcc_funk(PB_8); // Pin vcc funk modul 00009 #define TRANSFER_SIZE 2 00010 00011 00012 00013 int main() 00014 { 00015 // pLATHALTER FÜR ANSHCALTEN ÜBER GPIO 00016 // 00017 vcc_funk = 1; 00018 wait_us(30); 00019 nRF24L01P my_nrf24l01p(PB_5,PB_4,PB_3,PB_7,PD_2,PB_6); // mosi, miso, sck, csn, ce, irq 00020 00021 char txData[TRANSFER_SIZE]; 00022 int txDataCnt = 0; 00023 00024 my_nrf24l01p.powerUp(); 00025 my_nrf24l01p.setAirDataRate(250); 00026 my_nrf24l01p.setTxAddress(0xE7E7E7E7E1,5); 00027 my_nrf24l01p.setRxAddress(0xE7E7E7E7E7,5,0); 00028 00029 00030 my_nrf24l01p.setTransferSize( TRANSFER_SIZE ); 00031 00032 my_nrf24l01p.setTransmitMode(); 00033 my_nrf24l01p.enable(); 00034 txData[1] = 2; 00035 txData[0] = 23; 00036 txDataCnt =1; 00037 IWDG->KR=IWDG_START; 00038 IWDG->KR=IWDG_WRITE_ACCESS; 00039 IWDG->PR=IWDG_PR_PR_0; 00040 IWDG->RLR=IWDG_RELOAD; 00041 while(IWDG->SR) { 00042 wait_ms(1); 00043 } 00044 my_nrf24l01p.write( NRF24L01P_PIPE_P0, txData, txDataCnt ); 00045 IWDG->KR=IWDG_REFRESH; /* (6) */ 00046 deepsleep(); 00047 while (1) { 00048 } 00049 }
Generated on Tue Jul 19 2022 22:37:20 by
1.7.2
