Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminJo committed Oct 8, 2022
1 parent b9ec1e4 commit 7b32589
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
9 changes: 5 additions & 4 deletions OpenledRace/LiquidCrystal_I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ inline size_t LiquidCrystal_I2C::write(uint8_t value) {
#if defined(USE_SOFT_I2C_MASTER)
#define USE_SOFT_I2C_MASTER_H_AS_PLAIN_INCLUDE
#include "SoftI2CMaster.h"
#else
#define printIIC(args) Wire.write(args)
#elif defined(USE_SOFT_WIRE)
#define USE_SOFTWIRE_H_AS_PLAIN_INCLUDE
#include "SoftWire.h"
#endif

// When the display powers up, it is configured as follows:
Expand Down Expand Up @@ -63,7 +64,7 @@ void LiquidCrystal_I2C::init_priv() {
begin(_cols, _rows);
}

void LiquidCrystal_I2C::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
void LiquidCrystal_I2C::begin(uint8_t cols __attribute__((unused)), uint8_t lines, uint8_t dotsize) {
if (lines > 1) {
_displayfunction |= LCD_2LINE;
}
Expand Down Expand Up @@ -261,7 +262,7 @@ void LiquidCrystal_I2C::expanderWrite(uint8_t _data) {
i2c_write_byte(_Addr << 1, _data | _backlightval);
#else
Wire.beginTransmission(_Addr);
printIIC((int )(_data) | _backlightval);
Wire.write((int )(_data) | _backlightval);
Wire.endTransmission();
#endif
}
Expand Down
7 changes: 1 addition & 6 deletions OpenledRace/LiquidCrystal_I2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@

#include <inttypes.h>
#include "Print.h"
#if !defined(USE_SOFT_I2C_MASTER)
# if defined(USE_SOFT_WIRE)
#define USE_SOFTWIRE_H_AS_PLAIN_INCLUDE
#include "SoftWire.h"
# else
#if !defined(USE_SOFT_I2C_MASTER) && !defined(USE_SOFT_WIRE)
#include <Wire.h>
# endif
#endif

// commands
Expand Down
32 changes: 20 additions & 12 deletions OpenledRace/OpenLedRace.ino
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ void playMelodyAndShutdown();
void checkAndHandleWinner();
void checkForOvertakingLeaderCar();
bool checkForInputToStart();
void printConfigPinInfo(uint8_t aConfigPinNumber, const __FlashStringHelper *aConfigPinDescription, Print *aSerial);

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

Expand Down Expand Up @@ -1055,7 +1056,6 @@ void setup() {
#endif

sOnlyPlotterOutput = !digitalRead(PIN_ONLY_PLOTTER_OUTPUT);
bool tIsAnalogParameterInputMode = !digitalRead(PIN_MANUAL_PARAMETER_MODE);

if (!sOnlyPlotterOutput) {

Expand All @@ -1064,17 +1064,7 @@ void setup() {
Serial.println(
F(
"Connect pin " STR(PIN_ONLY_PLOTTER_OUTPUT) " to ground, to suppress such prints not suited for Arduino plotter"));
Serial.print(F("Pin " STR(PIN_MANUAL_PARAMETER_MODE) " is "));
if (!tIsAnalogParameterInputMode) {
Serial.print(F("dis"));
}
Serial.print(F("connected from ground -> AnalogParameterInputMode is "));

if (tIsAnalogParameterInputMode) {
Serial.println(F("enabled"));
} else {
Serial.println(F("disabled"));
}
printConfigPinInfo(PIN_MANUAL_PARAMETER_MODE, F("AnalogParameterInputMode"),&Serial);
}

#if defined(ENABLE_ACCELERATOR_INPUT)
Expand Down Expand Up @@ -1695,3 +1685,21 @@ void printBigNumber4(byte digit, byte leftAdjust) {
}
// Serial.println();
}

void printConfigPinInfo(uint8_t aConfigPinNumber, const __FlashStringHelper *aConfigPinDescription, Print *aSerial) {
aSerial->print(F("Pin "));
aSerial->print(aConfigPinNumber);
aSerial->print(F(" is"));
bool tIsEnabled = digitalRead(aConfigPinNumber) == LOW;
if (!tIsEnabled) {
aSerial->print(F(" not"));
}
aSerial->print(F(" connected to ground, "));
aSerial->print(aConfigPinDescription);
aSerial->print(F(" is "));
if (tIsEnabled) {
aSerial->println(F("enabled"));
} else {
aSerial->println(F("disabled"));
}
}
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# [OpenledRace](https://github.com/ArminJo/OpenledRace)
An implementation of the OpenledRace Arduino game

### Version 1.2.0

[![Badge License: GPLv3](https://img.shields.io/badge/License-GPLv3-brightgreen.svg)](https://www.gnu.org/licenses/gpl-3.0)
&nbsp; &nbsp;
[![Badge Version](https://img.shields.io/github/v/release/ArminJo/OpenledRace?include_prereleases&color=yellow&logo=DocuSign&logoColor=white)](https://github.com/ArminJo/OpenledRace/releases/latest)
Expand All @@ -14,8 +12,8 @@ An implementation of the OpenledRace Arduino game
[![Badge Build Status](https://github.com/ArminJo/OpenledRace/workflows/TestCompile/badge.svg)](https://github.com/ArminJo/OpenledRace/actions)
&nbsp; &nbsp;
![Badge Hit Counter](https://visitor-badge.laobi.icu/badge?page_id=ArminJo_OpenledRace)

<br/>

**Extended version** of the OpenLedRace "version Basic for PCB Rome Edition. 2 Player, without Boxes Track".<br/>
Available as [OpenLedRace example](https://github.com/ArminJo/NeoPatterns/tree/master/examples/OpenLedRace) in the [NeoPatterns library](https://github.com/ArminJo/NeoPatterns).

Expand Down

0 comments on commit 7b32589

Please sign in to comment.