Skip to content

Commit

Permalink
Version 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminJo committed Jan 31, 2024
1 parent 374b927 commit a597b4f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
19 changes: 10 additions & 9 deletions OpenledRace/OpenLedRace.ino
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
//#include "AvrTracing.hpp"

#define VERSION_EXAMPLE "1.3"
// 1.3 VU Bar animations - work in progress
// 1.4 - work in progress
// 1.3 Moved Bridge and loop, VU Bar animations
// 1.2 Improvements from Hannover Maker Faire
// 1.1 Hannover Maker Faire version

Expand Down Expand Up @@ -147,7 +148,7 @@ bool sSerialLCDAvailable;
#define PIN_FRICTION A1
#define PIN_DRAG A2

#define PIN_ONLY_PLOTTER_OUTPUT 12 // Verbose output to Arduino Serial Monitor is disabled, if connected to ground. This is intended for Arduino Plotter mode.
#define ONLY_PLOTTER_OUTPUT_PIN 12 // Verbose output to Arduino Serial Monitor is disabled, if connected to ground. This is intended for Arduino Plotter mode.
bool sOnlyPlotterOutput;

#define ANALOG_OFFSET 20 // Bias/offset to get real 0 analog value, because of high LED current on Breadboard, which cause a ground bias.
Expand Down Expand Up @@ -271,7 +272,7 @@ void playMelodyAndShutdown();
void checkAndHandleWinner();
void checkForOvertakingLeaderCar();
bool checkAllInputs();
void printConfigPinInfo(uint8_t aConfigPinNumber, const __FlashStringHelper *aConfigPinDescription, Print *aSerial);
void printConfigPinInfo(Print *aSerial, uint8_t aConfigPinNumber, const __FlashStringHelper *aConfigPinDescription);

extern volatile unsigned long timer0_millis; // Used for ATmega328P to adjust for missed millis interrupts

Expand Down Expand Up @@ -1043,7 +1044,7 @@ void setup() {

pinMode(PIN_RESET_GAME_BUTTON, INPUT_PULLUP);
pinMode(PIN_MANUAL_PARAMETER_MODE, INPUT_PULLUP);
pinMode(PIN_ONLY_PLOTTER_OUTPUT, INPUT_PULLUP);
pinMode(ONLY_PLOTTER_OUTPUT_PIN, INPUT_PULLUP);

#if defined(TIMING_TEST)
pinMode(PIN_TIMING, OUTPUT);
Expand All @@ -1058,16 +1059,16 @@ void setup() {
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
#endif

sOnlyPlotterOutput = !digitalRead(PIN_ONLY_PLOTTER_OUTPUT);
sOnlyPlotterOutput = !digitalRead(ONLY_PLOTTER_OUTPUT_PIN);

if (!sOnlyPlotterOutput) {

// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__));
Serial.println(
F(
"Connect pin " STR(PIN_ONLY_PLOTTER_OUTPUT) " to ground, to suppress such prints not suited for Arduino plotter"));
printConfigPinInfo(PIN_MANUAL_PARAMETER_MODE, F("AnalogParameterInputMode"), &Serial);
"Connect pin " STR(ONLY_PLOTTER_OUTPUT_PIN) " to ground, to suppress such prints not suited for Arduino plotter"));
printConfigPinInfo(&Serial, PIN_MANUAL_PARAMETER_MODE, F("AnalogParameterInputMode"));
}

#if defined(ENABLE_ACCELERATOR_INPUT)
Expand Down Expand Up @@ -1207,7 +1208,7 @@ void loop() {
sNextLoopMillis += MILLISECONDS_PER_LOOP;

sLoopCountForDebugPrint++;
sOnlyPlotterOutput = !digitalRead(PIN_ONLY_PLOTTER_OUTPUT);
sOnlyPlotterOutput = !digitalRead(ONLY_PLOTTER_OUTPUT_PIN);

#if defined(INFO) && defined(__AVR__)
if (!sOnlyPlotterOutput) {
Expand Down Expand Up @@ -1597,7 +1598,7 @@ void checkForLCDConnected() {
#endif
}

void printConfigPinInfo(uint8_t aConfigPinNumber, const __FlashStringHelper *aConfigPinDescription, Print *aSerial) {
void printConfigPinInfo(Print *aSerial, uint8_t aConfigPinNumber, const __FlashStringHelper *aConfigPinDescription) {
aSerial->print(F("Pin "));
aSerial->print(aConfigPinNumber);
aSerial->print(F(" is"));
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@
Also available as [OpenLedRace example](https://github.com/ArminJo/NeoPatterns/tree/master/examples/OpenLedRace) in the [NeoPatterns library](https://github.com/ArminJo/NeoPatterns).

</div>

#### If you find this library useful, please give it a star.

&#x1F30E; [Google Translate](https://translate.google.com/translate?sl=en&u=https://github.com/ArminJo/OpenLedRace)

<br/>

#### If you find this program useful, please give it a star.

# Extensions to standard version
* **Input from MPU6050 Accelerometer**.
* Classes for Car, Bridge, Ramp and Loop with **natural gravity**.
Expand Down Expand Up @@ -51,14 +58,14 @@ Formula is: **NewSpeed = OldSpeed + Gravity + Friction + (OldSpeed * Drag)**
<br/>

# Pictures
| At the Hannover MakerFaire 2022 | At the Cologne public library MINTköln-Festival 2021 |
| At the Hannover MakerFaire 2022 | At the Cologne public library MINTk&ouml;ln-Festival 2021 |
| :-: | :-: |
| ![Accelerometer version from MakerFaire 2022](https://github.com/ArminJo/OpenledRace/blob/master/pictures/Overview.jpg) | ![OpenLedRace at the Cologne public library MINTköln-Festival](https://github.com/ArminJo/OpenledRace/blob/master/pictures/OpenLedRaceAtMintFestival.jpg) |
| ![Accelerometer version from MakerFaire 2022](https://github.com/ArminJo/OpenledRace/blob/master/pictures/Overview.jpg) | ![OpenLedRace at the Cologne public library MINTk&ouml;ln-Festival](https://github.com/ArminJo/OpenledRace/blob/master/pictures/OpenLedRaceAtMintFestival.jpg) |

<br/>

# YouTube Videos
| At the Hannover MakerFaire 2022 | At the Cologne public library MINTköln-Festival 2021 |
| At the Hannover MakerFaire 2022 | At the Cologne public library MINTk&ouml;ln-Festival 2021 |
| :-: | :-: |
| [![OpenLedRace at the Hannover MakerFaire 2022](https://i.ytimg.com/vi/lYzYpFYJfWI/hqdefault.jpg)](https://www.youtube.com/watch?v=lYzYpFYJfWI) | [![OpenLedRace in action](https://i.ytimg.com/vi/y25rjRkDg0g/hqdefault.jpg)](https://www.youtube.com/watch?v=y25rjRkDg0g) |

Expand Down Expand Up @@ -110,5 +117,3 @@ Pin layout is defined [here](https://github.com/ArminJo/NeoPatterns/blob/master/
- https://twitter.com/openledrace
- https://gitlab.com/open-led-race
- https://openledrace.net/open-software/

#### If you find this program useful, please give it a star.

0 comments on commit a597b4f

Please sign in to comment.