aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-08-28 14:14:24 -0600
committerSelene ToyKeeper2017-08-28 14:14:24 -0600
commitd81ef25a7b1b06f092139487ee873f4fffcba237 (patch)
tree20690eabf40f78d05ee8a0ce32f0668eabf21bfb /spaghetti-monster
parentAdjusted default ramp values for general-purpose use. (diff)
downloadanduril-d81ef25a7b1b06f092139487ee873f4fffcba237.tar.gz
anduril-d81ef25a7b1b06f092139487ee873f4fffcba237.tar.bz2
anduril-d81ef25a7b1b06f092139487ee873f4fffcba237.zip
just ideas and minor cleanup
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril.c8
-rw-r--r--spaghetti-monster/anduril.txt11
2 files changed, 16 insertions, 3 deletions
diff --git a/spaghetti-monster/anduril.c b/spaghetti-monster/anduril.c
index e169f18..6eafb5d 100644
--- a/spaghetti-monster/anduril.c
+++ b/spaghetti-monster/anduril.c
@@ -26,9 +26,9 @@
#define USE_DELAY_4MS
#define USE_DELAY_ZERO
#define USE_RAMPING
+#define RAMP_LENGTH 150
#define USE_BATTCHECK
#define BATTCHECK_VpT
-#define RAMP_LENGTH 150
#define MAX_CLICKS 6
#define USE_EEPROM
#define EEPROM_BYTES 12
@@ -684,6 +684,8 @@ uint8_t number_entry_state(EventPtr event, uint16_t arg) {
}
+// find the ramp level closest to the target,
+// using only the levels which are allowed in the current state
uint8_t nearest_level(int16_t target) {
// bounds check
// using int16_t here saves us a bunch of logic elsewhere,
@@ -781,6 +783,7 @@ void low_voltage() {
void setup() {
+ // blink at power-on to let user know power is connected
set_level(RAMP_SIZE/8);
delay_4ms(3);
set_level(0);
@@ -792,6 +795,7 @@ void setup() {
void loop() {
+
// deferred "off" so we won't suspend in a weird state
// (like... during the middle of a strobe pulse)
if (go_to_standby) {
@@ -825,6 +829,7 @@ void loop() {
if (! nice_delay_ms(720)) return;
}
}
+
#ifdef USE_BATTCHECK
else if (current_state == battcheck_state) {
battcheck();
@@ -835,6 +840,7 @@ void loop() {
}
// TODO: blink out therm_ceil during thermal_config_state
#endif
+
else if (current_state == beacon_state) {
set_level(memorized_level);
if (! nice_delay_ms(500)) return;
diff --git a/spaghetti-monster/anduril.txt b/spaghetti-monster/anduril.txt
index 5e6d4b9..a9790b1 100644
--- a/spaghetti-monster/anduril.txt
+++ b/spaghetti-monster/anduril.txt
@@ -1,6 +1,6 @@
From off:
* 1 click: memorized level
- * Hold: Lowest level then ramp up
+ * Hold: lowest level then ramp up
* 2 clicks: highest ramp level
* Click, hold: highest level then ramp down
* 3 clicks: battcheck mode
@@ -60,7 +60,7 @@ Tempcheck mode:
- Hold: thermal calibration mode
Thermal config mode:
- * Click N times to set thermal limit to roughly 30 C + N.
+ * At buzz, click N times to set thermal limit to roughly 30 C + N.
Thermal calibration mode:
- Hold until hot: set new ceiling value
@@ -71,6 +71,9 @@ Beacon mode:
* 2 clicks: battcheck mode
* 3 clicks: configure time between pulses
+Beacon config mode:
+ * At buzz, click N times to set beacon frequency to N seconds.
+
Momentary mode:
* Press button: Light on (at memorized level).
* Release button: Light off.
@@ -79,6 +82,10 @@ Momentary mode:
TODO:
* save settings in eeprom
- decide on "hold until hot" or "click N times" for thermal config mode
+ - test thermal regulation on an actual light
+ - improve thermal regulation
- a way to blink out the firmware version?
- indicator LED support
- a way to configure indicator LED behavior?
+ - add goodnight mode?
+ - add lightning mode?
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.