File tree Expand file tree Collapse file tree 4 files changed +54
-0
lines changed Expand file tree Collapse file tree 4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ #ifdef DVL_H
2
+
3
+ #include <Arduino.h>
4
+
5
+ void dvl_setup ();
6
+ void dvl_loop ();
7
+
8
+ #endif
Original file line number Diff line number Diff line change @@ -43,6 +43,16 @@ lib_deps =
43
43
PaulStoffregen/XPT2046_Touchscreen
44
44
https://github.com/bluerobotics/BlueRobotics_MS5837_Library
45
45
46
+ [env:dvl]
47
+ platform = teensy
48
+ board = teensy40
49
+ framework = arduino
50
+ build_flags =
51
+ -D DVL_H
52
+ ${env.build_flags}
53
+ # upload_protocol = teensy-cli
54
+ upload_port = /dev/dvl
55
+
46
56
[env:power]
47
57
platform = teensy
48
58
board = teensy40
Original file line number Diff line number Diff line change
1
+ #ifdef DVL_H
2
+
3
+ #include " dvl_main.h"
4
+
5
+ // RX2 -> Pin 7 (receives data from DVL)
6
+ // TX2 -> Pin 8 (sends data to DVL)
7
+
8
+ void dvl_setup (){
9
+ Serial.begin (115200 );
10
+ Serial2.begin (115200 );
11
+
12
+ pinMode (LED_BUILTIN, OUTPUT);
13
+ digitalWrite (LED_BUILTIN, HIGH);
14
+ }
15
+
16
+ void dvl_loop (){
17
+ // Forward data from DVL (Serial2) to Jetson (Serial)
18
+ if (Serial2.available ()) {
19
+ int inByte = Serial2.read ();
20
+ Serial.write (inByte);
21
+ }
22
+
23
+ // Forward data from Jetson (Serial) to DVL (Serial2)
24
+ if (Serial.available ()) {
25
+ int inByte = Serial.read ();
26
+ Serial2.write (inByte);
27
+ }
28
+ }
29
+
30
+ #endif
Original file line number Diff line number Diff line change 4
4
#include " actuator_main.h"
5
5
#elif DISPLAY_H
6
6
#include " display_main.h"
7
+ #elif DVL_H
8
+ #include " dvl_main.h"
7
9
#elif POWER_H
8
10
#include " power_main.h"
9
11
#elif POWER_ROS1_H
@@ -15,6 +17,8 @@ void setup() {
15
17
actuator_setup ();
16
18
#elif DISPLAY_H
17
19
display_setup ();
20
+ #elif DVL_H
21
+ dvl_setup ();
18
22
#elif POWER_H
19
23
power_setup ();
20
24
#elif POWER_ROS1_H
@@ -27,6 +31,8 @@ void loop() {
27
31
actuator_loop ();
28
32
#elif DISPLAY_H
29
33
display_loop ();
34
+ #elif DVL_H
35
+ dvl_loop ();
30
36
#elif POWER_H
31
37
power_loop ();
32
38
#elif POWER_ROS1_H
You can’t perform that action at this time.
0 commit comments