Simple example program using semihosting for use with the WebStlink semihosting demo: https://devanlai.github.io/webstlink/demo/

Dependencies:   SemihostedFileSystem mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "SemihostedFileSystem.h"
00003 
00004 DigitalOut led(LED1);
00005 
00006 int main()
00007 {
00008     SemihostedFileHandle semi_stdout(":tt", O_WRONLY);
00009     int i = 0;
00010     while(1) {
00011         semi_stdout.printf("Hello world %d\n", i++);
00012         led = (i % 2);
00013         wait_ms(1000);
00014     }
00015 }