Skip to content

Commit

Permalink
Rename AUTOCOUNT_PIN setting to AUTOCOUNT_BIT
Browse files Browse the repository at this point in the history
  • Loading branch information
dakalamin committed Oct 26, 2024
1 parent 4a9f94d commit bf16f00
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ You can configure the project to your liking:
Setting | Category | Type | Default | Notes
----------------------: |---------- | ---- | --------- | :----
`BUTTON_PIN` | **`PIN`** | uint | `7` | -
`AUTO_PIN` | **`PIN`** | uint | `8` | 74HC595 shift register - pin `Q7`<br>_alternatively, can be pin_ `Q6`
`AUTO_PIN` | **`PIN`** | uint | `8` | pin that receives `AUTOCOUNT` signal
`DATA_PIN` | **`PIN`** | uint | `11` | 74HC595 shift register - pin `DS`
`LATCH_PIN` | **`PIN`** | uint | `12` | 74HC595 shift register - pin `ST_CP`
`CLOCK_PIN` | **`PIN`** | uint | `13` | 74HC595 shift register - pin `SH_CP`
Expand All @@ -151,7 +151,7 @@ Setting | Category | Type | Default | Notes
`BUTTON_CYCLE_MS` | **`BTN`** | uint | `1000` | delay between autoclicks while button is kept pressed _(in ms)_
`BRAILLE_CELLS` | **`CEL`** | uint | `4` | number of Braille cells if they are not automatically counted
`AUTOCOUNT_CELLS` | **`CEL`** | bool | `true` | if Braille cells must be automatically counted
`AUTOCOUNT_PIN` | **`CEL`** | uint | `7` | shift register pin number which passes `AUTOCOUNT` signal<br>`6` if pin is `Q6`<br>`7` if pin is `Q7`
`AUTOCOUNT_BIT` | **`CEL`** | uint | `7` | bit number that contains `AUTOCOUNT` signal passed to `AUTO_PIN`<br>`6`<sup>th</sup> bit corresponds to `Q6` shift register pin<br>`7`<sup>th</sup> bit - to `Q7`
`ANIMATION_ON_START` | **`ANM`** | bool | `true` | if to play animation on start
`ANIMATION_MS_PER_CELL` | **`ANM`** | uint | `500` | delay between each animation frame _(in ms)_

Expand Down
4 changes: 2 additions & 2 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ typedef uint8_t braille_t;
6 if pin is Q6
7 if pin is Q7
*/
#define AUTOCOUNT_PIN 7
#define AUTOCOUNT_BIT (1 << AUTOCOUNT_PIN)
#define AUTOCOUNT_BIT 7
#define AUTOCOUNT_BITMASK (1 << AUTOCOUNT_BIT)

#define ANIMATION_ON_START true
#define ANIMATION_MS_PER_CELL 500
Expand Down
2 changes: 1 addition & 1 deletion src/patterns.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
enum BrailleSpecial : braille_t {
NA = 0b111111, //
EMPTY = // ⠀ (not equal to 0)
UINT8_MAX & (~(NA | AUTOCOUNT_BIT)),
UINT8_MAX & (~(NA | AUTOCOUNT_BITMASK)),

DECADE_2 = 0b000100, //
DECADE_3 = 0b100100, //
Expand Down
2 changes: 1 addition & 1 deletion src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void _shiftOut(byte pattern=0) {

void countBrailleCells() {
#if AUTOCOUNT_CELLS
_shiftOut(AUTOCOUNT_BIT | ((ANIMATION_ON_START) ? NA : EMPTY));
_shiftOut(AUTOCOUNT_BITMASK | ((ANIMATION_ON_START) ? NA : EMPTY));

for (brailleCells = 0; digitalRead(AUTO_PIN); brailleCells++) {
delay((ANIMATION_ON_START) ? ANIMATION_MS_PER_CELL : MIN_DELAY_MS);
Expand Down

0 comments on commit bf16f00

Please sign in to comment.