Skip to content

Commit

Permalink
Remove libraries supporting rotary encoder, in preparation for applyi…
Browse files Browse the repository at this point in the history
…ng a license
  • Loading branch information
clockspot committed Jul 7, 2018
1 parent fac650d commit 5b0bdf5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Nixie clocks](https://i.imgur.com/FemMWax.jpg)

**A digital clock with perpetual calendar, alarm, countdown timer/appliance timer, and day counter.** Written for the Arduino Nano at the heart of [RLB Designs'](http://rlb-designs.com/) Universal Nixie Driver Board (UNDB) v5.0, featuring a DS3231 real-time clock, and driving up to 6 digits multiplexed in pairs via two SN74141 driver chips.
**A digital clock with perpetual calendar, alarm, countdown timer/appliance timer, and day counter.** Written for the Arduino Nano at the heart of [RLB Designs'](http://rlb-designs.com/) Universal Nixie Driver Board (UNDB), featuring a DS3231 real-time clock, and driving up to 6 digits multiplexed in pairs via two SN74141 driver chips.

[The latest release can be downloaded here.](https://github.com/clockspot/arduino-nixie/releases/latest) Skip to [Hardware Configuration](#hardware-configuration) for details on how to tweak the sketch.

Expand Down Expand Up @@ -67,7 +67,7 @@ A number of hardware-related settings are specified in consts at the top of the
* **How many tubes** in the display module. Default is 6; small display adjustments are made for 4-tube clocks.
* **Which functions** are enabled. Default is all but temperature and tube tester.
* **Which input pins** are associated with the Select and Adjust controls.
* **What type of Adjust controls** are equipped: pushbuttons (default) or rotary encoders.
* **What type of Adjust controls** are equipped: pushbuttons (default) or rotary encoder (unimplemented).
* **What type of signal outputs** are equipped: a piezo beeper (default) and/or a relay.
* **Signal duration** (default 3min) and **piezo pulse duration** (default 500ms)
* If relay is equipped, **relay mode**:
Expand Down
31 changes: 7 additions & 24 deletions sixtube_lm/sixtube_lm.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
// based on original sketch by Robin Birtles (rlb-designs.com) and Chris Gerekos
// based on http://arduinix.com/Main/Code/ANX-6Tube-Clock-Crossfade.txt

#include <EEPROM.h>
#include <DS3231.h>
#include <Wire.h>
#include <ooPinChangeInt.h>
#include <AdaEncoder.h>
#include <EEPROM.h> //Arduino - GNU LPGL
#include <Wire.h> //Arduino - GNU LPGL
#include <DS3231.h> //NorthernWidget - The Unlicense


////////// Hardware configuration consts //////////
Expand Down Expand Up @@ -43,7 +41,7 @@ const byte mainAdjDn = A0;
const byte altSel = 0; //alt select button - if unequipped, set to 0

// What type of adj controls are equipped?
// 1 = momentary buttons. 2 = quadrature rotary encoder.
// 1 = momentary buttons. 2 = quadrature rotary encoder (not supported presently)
const byte mainAdjType = 1;

// In normal running mode, what do the controls do?
Expand Down Expand Up @@ -246,7 +244,7 @@ void initInputs(){
pinMode(A6, INPUT); digitalWrite(A6, HIGH);
pinMode(A7, INPUT); digitalWrite(A7, HIGH);
//rotary encoder init
if(mainAdjType==2) AdaEncoder mainRot = AdaEncoder('a',mainAdjUp,mainAdjDn);
//TODO encoder support
}

void checkInputs(){
Expand All @@ -255,7 +253,7 @@ void checkInputs(){
//check button states
checkBtn(mainSel); //main select
if(mainAdjType==1) { checkBtn(mainAdjUp); checkBtn(mainAdjDn); } //if mainAdj is buttons
if(mainAdjType==2) checkRot(); //if mainAdj is rotary encoder
//if(mainAdjType==2) checkRot(); //if mainAdj is rotary encoder TODO encoder support
if(altSel!=0) checkBtn(altSel); //alt select (if equipped)
}

Expand Down Expand Up @@ -297,22 +295,7 @@ void btnStop(){

void checkRot(){
//Changes in rotary encoder. When rotation(s) occur, will call ctrlEvt to simulate btn presses.
if(btnCur==0) {
//https://github.com/GreyGnome/AdaEncoder/blob/master/Examples/MyEncoder/MyEncoder.ino
AdaEncoder *thisEncoder=NULL;
thisEncoder = AdaEncoder::genie();
if(thisEncoder!=NULL) {
unsigned long inputThis = millis();
if(inputThis-inputLast < 70) return; //ignore inputs that come faster than a human could rotate
int8_t clicks = thisEncoder->query(); //signed number of clicks it has moved
byte dir = (clicks<0?0:1);
clicks = abs(clicks);
for(byte i=0; i<clicks; i++){ //in case of more than one click
ctrlEvt((dir?mainAdjUp:mainAdjDn),1);
}
inputLast2 = inputLast; inputLast = inputThis;
}
}
//TODO rotary encoder support
}//end checkRot


Expand Down

0 comments on commit 5b0bdf5

Please sign in to comment.