Browse Source

add echo demo to test the RX pin setup in JeeH

Jean-Claude 2 months ago
parent
commit
b3a2264efa
2 changed files with 34 additions and 0 deletions
  1. 18
    0
      nucleo-l031/echo/platformio.ini
  2. 16
    0
      nucleo-l031/echo/src/main.cpp

+ 18
- 0
nucleo-l031/echo/platformio.ini View File

@@ -0,0 +1,18 @@
1
+; PlatformIO Project Configuration File
2
+;
3
+;   Build options: build flags, source filter
4
+;   Upload options: custom upload port, speed and extra flags
5
+;   Library options: dependencies, extra library storages
6
+;   Advanced options: extra scripting
7
+;
8
+; Please visit documentation for the other options and examples
9
+; http://docs.platformio.org/page/projectconf.html
10
+
11
+[env:nucleo]
12
+build_flags = -D STM32L0
13
+platform = ststm32
14
+board = nucleo_l031k6
15
+framework = stm32cube
16
+upload_protocol = mbed
17
+monitor_speed = 115200
18
+lib_deps = jeeh

+ 16
- 0
nucleo-l031/echo/src/main.cpp View File

@@ -0,0 +1,16 @@
1
+#include <jee.h>
2
+
3
+UartDev< PinA<2>, PinA<15> > console;
4
+
5
+PinB<3> led;
6
+
7
+int main() {
8
+    console.init();
9
+    console.putc('+');
10
+    led.mode(Pinmode::out);
11
+
12
+    while (true) {
13
+        console.putc(console.getc());
14
+        led.toggle();
15
+    }
16
+}

Loading…
Cancel
Save