![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
UD-GS01治具の試作プログラムです
Dependencies: mbed nRF24L01P SDFileSystem
Diff: Goto_UD-GS01.cpp
- Revision:
- 12:d935d1243611
- Parent:
- 11:e3549d37183a
- Child:
- 13:8357704ad091
--- a/Goto_UD-GS01.cpp Thu Dec 10 08:31:02 2020 +0000 +++ b/Goto_UD-GS01.cpp Fri Dec 11 09:14:15 2020 +0000 @@ -30,7 +30,7 @@ int open_flg = 0; -nRF24L01P my_nrf24l01p(D11, D12, D13, D10, D9,D8); // mosi, miso, sck, csn, ce, irq +nRF24L01P my_nrf24l01p(PC_3, PC_2, PB_10, PC_4, D9,D8); // mosi, miso, sck, csn, ce, irq //nRF24L01P my_nrf24l01p(p5, p6, p7, p8, p9, p10); // mosi, miso, sck, csn, ce, irq void timer(){ @@ -96,7 +96,7 @@ my_nrf24l01p.enable(); - SDFileSystem *sd = new SDFileSystem(PB_15, PB_14, PB_13, PB_11, "sd", NC, SDFileSystem::SWITCH_NONE, 20000000); // mosi, miso, sclk, name, cs, card detect, sw type, freq + SDFileSystem *sd = new SDFileSystem(D11, D12, D13, D10, "sd", NC, SDFileSystem::SWITCH_NONE, 20000000); // mosi, miso, sclk, name, cs, card detect, sw type, freq wait_ms(100); // my_nrf24l01p.write( NRF24L01P_PIPE_P0, (char*)rxData,1);//dummy @@ -113,9 +113,16 @@ memcpy(rxData2, rxData1, TRANSFER_SIZE); wait(0.5); memcpy(rxData3, rxData1, TRANSFER_SIZE); - + phoenix : if(open_flg == 0){ - fp = fopen("/sd/testlog.txt", "a"); + fp = fopen("/sd/testlog", "a"); + + if (fp == NULL) + { + printf("open error!!\r\n"); + goto phoenix; + + } open_flg = 1; }