Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v9.13 #72

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
12 changes: 0 additions & 12 deletions .github/FUNDING.yml

This file was deleted.

10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"C_Cpp.dimInactiveRegions": true,
"cmake.configureOnOpen": false
"cmake.configureOnOpen": false,
"files.associations": {
"system_error": "cpp",
"array": "cpp",
"functional": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp"
}
}
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# This is an Arduino RC engine sound & light controller for ESP32

[![GitHub latest release version](https://img.shields.io/github/v/release/TheDIYGuy999/Rc_Engine_Sound_ESP32.svg?style=flat)](https://github.com/TheDIYGuy999/Rc_Engine_Sound_ESP32/releases/latest)
[![Github All Releases download count](https://img.shields.io/github/downloads/TheDIYGuy999/Rc_Engine_Sound_ESP32/total.svg?style=flat)](https://github.com/TheDIYGuy999/Rc_Engine_Sound_ESP32/releases/latest)
[![GitHub contributors](https://img.shields.io/github/contributors/TheDIYGuy999/Rc_Engine_Sound_ESP32.svg?style=flat)](https://github.com/TheDIYGuy999/Rc_Engine_Sound_ESP32/graphs/contributors)

It's based on the ATmega 328 version: https://github.com/TheDIYGuy999/Rc_Engine_Sound
and on bitlunis Halloween example: https://github.com/bitluni/MotionPumpkin

Expand All @@ -11,15 +16,34 @@ Video series: https://www.youtube.com/playlist?list=PLGO5EJJClJBCjIvu8frS7LrEU3H
You can find the changes in the [Changelog](documentation/Changelog.md).
************************************************************************

Discussion and support thread (in German): https://www.rc-modellbau-portal.de/index.php?threads/esp32-arduino-rc-sound-und-licht-controller.7183/
Discussion and support thread (in German & English): https://www.rc-modellbau-portal.de/index.php?threads/esp32-arduino-rc-sound-und-licht-controller.7183/

New: fully assembled, tested and working 30 pin SMD version with switch mode PSU & display connector.
Fully assembled, tested and working 30 pin SMD version with switch mode PSU & display connector.
Order it here: https://www.pcbway.com/project/shareproject/Arduino_RC_engine_sound_light_controller_for_ESP32_a9334731.html
![](documentation/pictures/30pinSmdSwitchModeVersion.jpg)
![](documentation/pictures/30pinSmdSwitchModeVersion.png)

New: STL data for nice 3D printed housing available:
https://thediyguy999.github.io/TheDIYGuy999_ESP32_Web_Flasher/products.html
![](documentation/pictures/ESP32SoundAndLightController.png)

New: Compact version for trailer or tractor:
https://thediyguy999.github.io/TheDIYGuy999_ESP32_Web_Flasher/products.html
![](documentation/pictures/ESP32TrailerController.png)

New: RZ7886 7A ESC:
https://thediyguy999.github.io/TheDIYGuy999_ESP32_Web_Flasher/products.html
![](documentation/pictures/RZ7886top.png)

New: wireless built-in configuration website 192.168.4.1
![](documentation/pictures/Configuration.png)

New: LCD dashboard (original by Frevic)
![](documentation/pictures/dashboard2.JPG)
https://www.facebook.com/profile.php?id=100066616574355

LCD dashboard (original by Gamadril)
![](documentation/pictures/dashboard.JPG)

Fully assembled, tested and working 30 pin SMD version, manufactured and pre-assembled by https://www.pcbway.com
![](documentation/pictures/30pinSmdVersion.jpg)

Expand All @@ -31,10 +55,6 @@ Compact version for excavator (IBUS & sound only, supplied by 6V BEC)
![](documentation/pictures/compact2.JPG)
![](documentation/pictures/compact3.JPG)

LCD dashboard (original by Gamadril)
![](documentation/pictures/dashboard.JPG)


## Features:
- Unique vehicle mass inertia simulation (connect your crawler type ESC to pin 33). Throttle output is altered during shifting of a mechanical 3 speed transmission for smooth shifting, gear protection and realistic sound. Works just fine with TAMIYA 3 speed transmissions. Should work as well with crawler 2 speed transmissions. The ESC is controlled by a state machine with the following states: driving forward & reverse (varible acceleration, depending on throttle position), neutral, braking forward & reverse (variable deceleration with fine granularity, according to "reverse throttle" position). It also allows to control the brake lights, the brake sound, the reversing light & the reversing beep sound properly. Acceleration & deceleration (coasting & braking) are adjustable separately for each gear to ensure maximum realism.
- Unique "virtual clutch" allows to rev the engine below an adjustable ESC output speed. Above, the clutch engages and ensures, that the engine sound is in synch with the wheel RPM. Sounds and behaves just great in combination with a shifting transmission!
Expand Down
2 changes: 2 additions & 0 deletions documentation/BigSurFix.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Deprecated: not required anymore, if VS code is used instead of Arduino IDE

# This document explains how to solve the macOS Big Sur ESP32 compiling error

On a vanilla ESP32 board definition installation on mac OS Big Sur, the ESP32 throws the following (or similar) Python compiling error:
Expand Down
35 changes: 35 additions & 0 deletions documentation/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

### Todo:
- Remove in vehicle files: XENON_LIGHTS, LED_INDICATORS, INDICATOR_DIR, doubleFlashBlueLight
- Add to EEPROM & select box: DOUBLE_CLUTCH and other transmission options

### 9.13.0-b7:
- Defines removed: HAZARDS_WHILE_5TH_WHEEL_UNLOCKED
- Variables added (adjustable on 192.168.4.1): hazardsWhile5thWheelUnlocked
- Neopixel animation mode selectable in dropdown menu on 192.168.4.1

### 9.13.0-b6:
- Defines removed: NO_CABLIGHTS, NO_FOGLIGHTS, XENON_LIGHTS, FLICKERING_WHILE_CRANKING, SEPARATE_FULL_BEAM
- Variables removed: INDICATOR_DIR
- Variables added (adjustable on 192.168.4.1): noCabLights, noFogLights, xenonLights, flickeringWileCranking, swap_L_R_indicators, separateFullBeam, flashingBlueLight

### 9.13.0-b5:
- First light settings available on 192.168.4.1
- Website with collapsible sections to keep it more organized

### 9.13.0-b4:
- Servo positions adjustable on 192.168.4.1
- Improved website look
- Scania dashboard splash logo by Frikkiebester

### 9.13.0-b3:
- Dashboard requires less processing power, no engine rpm lagging anymore, if Frevic dashboard is used

### 9.13.0-b2:
- More adjustable ESC parameters on 192.168.4.1
- Dashboard improved & optional dashboard from Frevic implemented. Select it in "dashboard.h" by uncommenting "#define FREVIC_DASHBOARD"

### 9.13.0-b1:
- New parameter "#define NEOPIXEL_ON_CH4" in "6_Lights.h" allows to connect the NEOPIXELS to servo CH 4 (BUS mode only, no 5th wheel servo in this case)
- ESC parameters are adjustable via 192.168.4.1
- in "#define WEMOS_D1_MINI_ESP32" mode only: Experimental Serial command interface for ESC parameters

### 9.12.0:
- Support for 36 Pin version removed
- Support for Wemos D1 Mini ESP32 added (#define WEMOS_D1_MINI_ESP32 in "0_generalSettings.h"). Allows to use the upcoming wireless trailer controller as modular sound controller.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/pictures/Configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/pictures/RZ7886top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/pictures/dashboard.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/pictures/dashboard2.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ board_build.partitions = huge_app.csv ; this setting enables more flash memory f
monitor_speed = 115200
;monitor_port = COM4 ;your port may vary!
upload_protocol = esptool
upload_speed = 921600 ; lower it to 115200, if you have upload issues
;upload_port = COM4 ;your port may vary!
;upload_port = /dev/cu.wchusbserial52BC0196871
monitor_filters = esp32_exception_decoder ; This option will show more informations in case of a backtrace!
Expand Down
Binary file modified src/.DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions src/0_generalSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
//#define CORE_DEBUG // Don't use this!

// EEPROM settings ---------------------------------------------------------------------------------------------------------------------------------
uint8_t eeprom_id = 2; // change this id (between 1 and 255, compare with serial monitor), if you want to restore EEPROM defaults (only executed 1x) <<------------- NOTE!
uint8_t eeprom_id = 5; // change this id (between 1 and 255, compare with serial monitor), if you want to restore EEPROM defaults (executed if different) <<------------- NOTE!
//#define ERASE_EEPROM_ON_BOOT // EEPROM is completely overwritten, if defined! Never define it, vehicle will not work!
// only define it in order to clean up junk from old projects in your EEPROM

// Wireless settings -------------------------------------------------------------------------------------------------------------------------------
#define ENABLE_WIRELESS // Define this, if you want to use an ESP-Now wireless trailer or the WiFi configuration via 192.168.4.1
//#define ENABLE_WIRELESS // Define this, if you want to use an ESP-Now wireless trailer or the WiFi configuration via 192.168.4.1

/* Wifi & ESP-Now and ESP-Now transmission power: less power = less speaker noise & longer battery life. Valid options are:
WIFI_POWER_19_5dBm = 78 // full power
Expand Down
12 changes: 8 additions & 4 deletions src/1_Vehicle.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
// #include "vehicles/VolvoFH16_OpenPipe.h" // Volvo FH truck. Inline 6, open pipes, alternative version
// #include "vehicles/ManTgx.h" // MAN TGX 680 V8 truck
// #include "vehicles/ManKat.h" // MAN KAT V8 Diesel German Bundeswehr military truck
// #include "vehicles/MagirusDeutz256.h" // Magirus Deutz 256 air coolded V8 Diesel truck
// #include "vehicles/MagirusMercur125.h" // Magirus Mercur air coolded V6 Diesel truck
#include "vehicles/Saurer2DM.h" // Swiss Saurer 2DM R6 Diesel truck
// #include "vehicles/MagirusDeutz256.h" // Magirus Deutz 256 air cooled V8 Diesel truck
// #include "vehicles/MagirusMercur125.h" // Magirus Mercur air cooled V6 Diesel truck
// #include "vehicles/Saurer2DM.h" // Swiss Saurer 2DM R6 Diesel truck

// Russian trucks --------
// #include "vehicles/Ural4320.h" // URAL 4320 6x6 V8 Diesel military truck
Expand All @@ -49,12 +49,16 @@

// Tractors -------
// #include "vehicles/KirovetsK700.h" // Russian Kirovets K700 monster tractor. Extreme turbo sound!
// #include "vehicles/FergusonTEA20.h" // 1940ies Ferguson TEA20 petrol engine tractor

// Excavators -------
// #include "vehicles/Caterpillar323Excavator.h" // Caterpillar 323 excavator (use "FLYSKY_FS_I6S_EXCAVATOR" remote profile)

// Dumpers -------
// #include "vehicles/Benford3TonDumper.h" // Benford 3 ton dumper
// #include "vehicles/Benford3TonDumper.h" // Benford 3 ton dumper

// Loaders -------
#include "vehicles/VolvoL120H.h"

// US motorcycles --------
// #include "vehicles/HarleyDavidsonFXSB.h" // Harley Davidson FXSB V2 motorcycle
Expand Down
74 changes: 73 additions & 1 deletion src/2_Remote.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <Arduino.h>

// Select (remove //) the remote configuration profile you have:
#define FLYSKY_FS_I6X // <------- Flysky FS-i6x
// #define FLYSKY_FS_I6X // <------- Flysky FS-i6x
#define FLYSKY_FS_I6S_LOADER // <------- Flysky FS-i6s for BURNIE222 Volvo L120H loader (use IBUS communication setting)
// #define FLYSKY_FS_I6S_EXCAVATOR // <------- Flysky FS-i6s for KABOLITE K336 hydraulic excavator (use IBUS communication setting)
// #define FLYSKY_GT5 // <------- Flysky GT5 / Reely GT6 EVO / Absima CR6P
// #define RGT_EX86100 // <------- MT-305 remote delivered with RGT EX86100 crawler (use PWM communication setting)
Expand Down Expand Up @@ -152,6 +153,77 @@ boolean sbusInverted = true; // true = standard (non inverted) SBUS signal

#endif

// Flysky FS-i6S remote configuration profile (for loaders only) --------------------------------------------------------------------------------------
#ifdef FLYSKY_FS_I6S_LOADER

// NOTE: The vehicle file needs to contain #define LOADER_MODE

// Channel assignment (use NONE for non existing channels!)
// Remote channel ####### // Sound controller channel ##########################################
#define STEERING 1 // CH1 bucket
#define GEARBOX 2 // CH2 lift
#define THROTTLE 3 // CH3 throttle & brake (right throttle in tracked mode)
#define HORN 9 // CH4 horn and bluelight / siren 3 pos switch SWB
#define FUNCTION_R 7 // CH5 jake brake, high / low beam, headlight flasher, engine on / off VRB
#define FUNCTION_L 6 // CH6 indicators, hazards VRA
#define POT2 NONE // CH7 pot 2
#define MODE1 NONE // CH8 mode 1 switch
#define MODE2 NONE // CH9 mode 2 switch
#define MOMENTARY1 NONE // CH10
#define HAZARDS NONE // CH11
#define INDICATOR_LEFT NONE // CH12
#define INDICATOR_RIGHT NONE // CH13

// Channels reversed or not
boolean channelReversed[14] = {
false, // CH0 (unused)
false, // CH1
false, // CH2
false, // CH3
false, // CH4
true, // CH5
false, // CH6
false, // CH7
false, // CH8
false, // CH9
false, // CH10
false, // CH11
false, // CH12
false // CH13
};

// Channels auto zero adjustment or not (don't use it for channels without spring centered neutral position, switches or unused channels)
boolean channelAutoZero[14] = {
false, // CH0 (unused)
true, // CH1
false, // CH2
true, // CH3
false, // CH4
true, // CH5
true, // CH6
false, // CH7
false, // CH8
false, // CH9
false, // CH10
false, // CH11
false, // CH12
false // CH13
};

// Channels signal range calibration -----
const uint16_t pulseNeutral = 30;
const uint16_t pulseSpan = 480;

// Automatic or manual modes -----
// #define AUTO_LIGHTS
// #define AUTO_ENGINE_ON_OFF
// #define AUTO_INDICATORS

// SBUS mode ----
boolean sbusInverted = true; // true = standard (non inverted) SBUS signal

#endif

// Flysky FS-i6S remote configuration profile (for excavators only) ---------------------------------------------------------------------------------
#ifdef FLYSKY_FS_I6S_EXCAVATOR

Expand Down
Loading