1st working program
Dependencies: mbed-os_TYBLE16 BME280_SPI RX8025NB nRF51_Vdd MB85RSxx_SPI
see /users/kenjiArai/notebook/tyble16-module-as-mbed-os-5-board-mbedlization/
Diff: main.cpp
- Revision:
- 0:6eea047171a3
diff -r 000000000000 -r 6eea047171a3 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Apr 10 12:43:29 2018 +0000 @@ -0,0 +1,45 @@ +/* + * Mbed Application program / Blinky + * + * Copyright (c) 2018 Kenji Arai / JH1PJL + * http://www.page.sannet.ne.jp/kenjia/index.html + * http://mbed.org/users/kenjiArai/ + * Created: April 10th, 2018 + * Revised: April 10th, 2018 + */ + +// Include -------------------------------------------------------------------- +#include "mbed.h" +#include "TYBLE16_BASE.h" + +// Definition ----------------------------------------------------------------- + +// Constructor ---------------------------------------------------------------- +DigitalOut my_led(LED1); +Serial pc(USBTX, USBRX); + +// RAM ------------------------------------------------------------------------ + +// ROM / Constant data -------------------------------------------------------- +char *const opngmsg = + "\x1b[2J\x1b[H"__FILE__ "\r\n"__DATE__ " " __TIME__ " (UTC)\r\n""\r\n"; + +// Function prototypes -------------------------------------------------------- + +//------------------------------------------------------------------------------ +// Control Program +//------------------------------------------------------------------------------ +int main() +{ + uint32_t count = 0; + + pc.puts(opngmsg); + // Check TYBLE-16 configuration + cpu_sys(); + compile_condition(); + while(true) { + my_led = !my_led; + pc.printf("%8u\r\n", count++); + Thread::wait(1000); + } +}