You don’t want to do both voltage and temperature monitoring?
If you want to do only temperature I assume you don’t want a “critical” value which turns the light off, only a step-down temperature. In that case I’d do something like this:
Replace:
#define ADC_LOW 130
#define ADC_CRIT 120
with
#define ADC_LOW 130
#define ADC_CRIT 0
also replace
if (ADCH < voltage_val) {
with
if (ADCH > voltage_val) {
That’s a pretty dirty way to hack the code. It should work I think, but I don’t like it. For my own use I’d want a separate check done for temperature.
Sure. Remember that I did not try it, but I think it will work fine. Will you post a thread about your temperature monitoring? I would like to do that myself.
It seems it works as I modify: #define ADC_LOW 130 (130=56C) #define ADC_CRIT 140 (140=60C)
Change
if (ADCH < voltage_val) {
if (++lowbatt_cnt > 8)
to
if (ADCH > voltage_val) {
if (—lowbatt_cnt > 8)
In fact, the 140 shut off the light will not happen because the power to LED already has been ramped down when the temperature reach 130.
If you're using MODE_HIGH as your single mode, and not turbo, you also need to comment out #define TURBO_TIMEOUT.
Are you also disabling low voltage monitoring? (if so, why?) When you comment out settings at the top, you have to go hunt for other stuff farther down that refers to the things you disabled. If you re-enable #define VOLTAGE_MON those two errors will go away and it builds correctly.
Cool. Good point, I guess a sudden jump from 55c to 60c would be a huge thermal shock: never going to happen unless you drop it in a volcano. I hadn’t thought of that.
I think for step-down to work some extra stuff has to be done. STAR steps down by lowering the mode index (it changes the mode to a lower one). If you only have one mode defined then the stock STAR ontime or offtime firmware can’t step down. Momentary might be different, I don’t remember.
I think RMM has a post about that subject around here somewhere. I don’t recall how he was working around it.
zeremefico, “MODE_TURBO” (255) mode includes a timed step-down to “MODE_HIGH_W_TURBO” (110). This is independent from the low-voltage-protection step-down. “MODE_HIGH” (255) uses the same brightness but does not include a timed step-down. You do want Turbo?
I took star off-time memory 1.3 and modified it to add the feature that the longer press (of reverse clicky switch) cycles back the mode. (It’s less than 10 lines of additional code).
Let me start by saying thanks to RMM and to everyone who has contributed to this code.
Let me say next you can put what I know about doing this between these 2 brackets ( ). Not much. With that in mind...
Tom that is awesome.
Am I understanding correctly that this code can be used with a 7135 based driver and ONLY a momentary switch (no dual switch)?
If so how do you wire the switch? Got a picture maybe?
Finally would it be possible to get this code in an elf or hex? I really know nothing a bout writing code, but I do have an avr programmer running AVR studio 4 if that will work.