File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed
Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 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+ ; https://docs.platformio.org/page/projectconf.html
10+
11+ [env:esp32doit-devkit-v1]
12+ platform = espressif32
13+ board = esp32doit-devkit-v1
14+ framework = arduino
15+ lib_deps =
16+ https://github.com/mestrode/Lin-Interface-Library
Original file line number Diff line number Diff line change 1+ #include < Arduino.h>
2+ #include < Lin_Interface.hpp>
3+
4+ // using UART 1 for LinBus
5+ Lin_Interface LinBus (1 );
6+
7+ int LIN_ScanIDs ()
8+ {
9+ int Result = 0 ;
10+ Serial.print (" \n\n ############# LIN ID scan started\n " );
11+ // Scan all IDs
12+ for (int i = 0 ; i <= 0x3F ; i++)
13+ {
14+ if (LinBus.readFrame (i))
15+ {
16+ Result++;
17+ }
18+ delay (10 );
19+ }
20+ Serial.print (" ############# Chk Sum valid on " );
21+ Serial.print (Result);
22+ Serial.print (" Frames\n ############# LIN ID scan finished\n\n " );
23+
24+ return Result;
25+ }
26+
27+ void setup ()
28+ {
29+ Serial.begin (115200 );
30+
31+ // configure baud rate
32+ Serial.print (" configure Lin-Bus to 19200 Baud\n " );
33+ LinBus.baud = 19200 ;
34+
35+ LIN_ScanIDs ();
36+
37+ Serial.print (" May you want to try other Baud rates?\n " );
38+ }
39+
40+ void loop ()
41+ {
42+ delay (5000 );
43+ }
You can’t perform that action at this time.
0 commit comments