From da7902b460ade810033afcf3772d916c580d91f4 Mon Sep 17 00:00:00 2001 From: spikerguy <48839029+spikerguy@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:14:28 +0300 Subject: [PATCH] Add Arduino upload, Test cmd and log location (#6) * add log, arduino upload and Test * use correct path * add haptic nodes * readme: add haptic and arduino motor connection --- README.md | 17 +++++++++++++++++ conf/monocoque.config | 21 ++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 858387d..eb493ed 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,21 @@ ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url htt make ``` +### Uploading sketch to Arduino Uno +``` +cd ../src/arduino/{simwind/shiftlights/simhaptic} # Depending on the controller you have. +make # Make sure serial connection is the same as on the host pc and it have the right group permission to access the device without root +``` + +### SimHaptic Ardunio Motor Connection +- Acc Pedal Motor to be connected to M1 +- Brake Pedal Motor to be connected to M3 + + ## Testing +``` +./monocoque test -vv # Make sure that ~/.config/monocque/monocoque.config only contains the devices you have connected. +``` ### Static Analysis ``` @@ -95,6 +109,9 @@ make valgrind -v --leak-check=full --show-leak-kinds=all --suppressions=../.valgrindrc ./monocoque play ``` +### Logs file location +`~/.cache/monocoque/*.log` + ## ToDo - windows port - more memory testing diff --git a/conf/monocoque.config b/conf/monocoque.config index cbe73b0..95bf17d 100644 --- a/conf/monocoque.config +++ b/conf/monocoque.config @@ -42,4 +42,23 @@ devices = ( { device = "USB"; { device = "Serial"; type = "ShiftLights"; config = "None"; - devpath = "/dev/ttyACM0"; } ); + devpath = "/dev/ttyACM0"; }, + { device = "Serial"; + type = "Haptic"; + effect = "TyreSlip"; + tyre = "ALL"; // motor m1 connected to throttle + motors = 0; + devpath = "/dev/ttyACM0"; }, + { device = "Serial"; + type = "Haptic"; + effect = "TyreLock"; + tyre = "ALL"; // motor m3 connected to brake; + motors = 2; + devpath = "/dev/ttyACM0"; }, + { device = "Serial"; + type = "Haptic" + effect = "ABS"; + tyre = "ALL"; // this will have to be documented, this tells the code to spin both motors + motors = 8; + devpath = "/dev/ttyACM0";} + );