Skip to content
Snippets Groups Projects
Commit ea68b305 authored by Jan Grewe's avatar Jan Grewe
Browse files

add README

rename some variables
parent be87e6bf
Branches
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
using namespace ace_button; using namespace ace_button;
#define ROTATIONS 1 #define CYCLES 1
#define ROT_R 2 #define ROT_R 2
#define ROT_L 2 #define ROT_L 2
#define ROT_STEPS 4096 #define ROT_STEPS 4096
...@@ -37,7 +37,7 @@ AceButton pwr_sw(SW_PIN); ...@@ -37,7 +37,7 @@ AceButton pwr_sw(SW_PIN);
int TargetPos = 0; int TargetPos = 0;
long StartTime = 0; long StartTime = 0;
int Rotations = ROTATIONS; int Rotations = CYCLES;
StateType WState = W_INIT; StateType WState = W_INIT;
int Restart = false; int Restart = false;
int Continue = false; int Continue = false;
...@@ -84,7 +84,7 @@ void loop() ...@@ -84,7 +84,7 @@ void loop()
} }
StartTime = millis(); StartTime = millis();
winder.enableOutputs(); winder.enableOutputs();
Rotations = ROTATIONS; Rotations = CYCLES;
break; break;
case W_CYCLE: case W_CYCLE:
......
# Open Watch Winder
This code allows you to control a stepper motor with a momentary switch button.
## Using the Winder
On powerup, the LED will fade on an the winder will be in standby, waiting for a button press.
The button knows two types of inputs:
* **press**, which is input shorter than 500ms
* **long-press**, which is input longer than 500ms
The winder works in cycles, which means it will do the configured number of cycles (`CYCLES`), with each cycle consisting of a configured number of rotations in each direction (`ROT_R`, `ROT_L`), then wait for the
configured amount of minutes (`PAUSE_MIN`), and eventually restart the cycles. This will be refered to as "_winding_".
In short:
* press the button to start winding
* long-press the button to stop winding
### Switching Modes
* When pressing the button while the winder is in standby, it will start winding.
* When long-pressing the button while it is winding, it will return to the home position and stop winding.
* When long-pressing the button while it is waiting for the next cycle, it will stop winding.
* When pressing the buttong while it is waiting for the next cycle, it will start winding.
## LED Status
* **Solid**: Standby
* **Blinking** (1s on, 0.5s off): Winding
* **Slow Breathing**: Waiting for next cycles
* **Fast Breathing**: Next cycle will start in <1 minute
## Wiring Diagram
<a href="https://git.faked.org/jan/openwatchwinder/raw/master/wiring.png"><img src="https://git.faked.org/jan/openwatchwinder/raw/master/wiring.png" alt="Wiring Diagram" width="500"/></a>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment