Flashlight Firmware Repository

The opposite seems to be the case. The temperature sensor lags behind massively.

See: Flashlight Firmware Repository - #2160 by 0-8-15_User

A branch with a much improved strobe mode (D4v2 only). It can “freeze” a motor that’s spinning at 20000 RPM, just like a professional strobe!

https://code.launchpad.net/~i-dan-3/flashlight-firmware/pwm-strobe


Added accurate 16-bit PWM strobe modes

Disabled by default. Only supported on CPUs having a 16-bit PWM, which means only attiny1634, which means only Emisar D4v2 and D4Sv2. I don’t have a D4Sv2 to test, so currently it’s only implemented on D4v2. The relevant functions could probably be directly copied from hwdef-Emisar_D4v2.h to hwdef-Emisar_D4Sv2.h.

Strobe rate can be continuously varied from 1Hz to 500Hz. Theoretically it could run faster, but this is already enough to freeze something that’s spinning at 30000 RPM. Uses full brightness (1x7135 plus FET) with a 1:256 duty cycle (party strobe) or 1:4 duty cycle (tactical strobe). Rate adjustment has acceleration, going twice as fast after 1 second and 4x as fast after 2 seconds. It still takes about 10 seconds to traverse the whole range from 1Hz to 500Hz.

With this I was able to freeze my Proxon drill (similar to Dremel) running at 20000 RPM. Unfortunately the flash rate fluctuates by about 0.1%, probably due to the CPU’s RC oscillator.

Anduril have no indicator led LVP ? Aux leds maybe off, but indicator led keeps shining until battery kaputt :wink:

Maybe this line have to be fixed?

#if defined(USE_INDICATOR_LED) && defined(TICK_DURING_STANDBY)
// beacon-like mode for the indicator LED
void indicator_blink(uint8_t arg) {
// turn off aux LEDs when battery is empty
if (voltage < VOLTAGE_LOW) { indicator_led(0); return; }

In blinking mode LPV works , but in low or high modes not at all.

No, I believe it’s this place:

// TODO: turn off aux LED (s) when power is really low

if (0) {} // placeholder

So…it seems simply unimplemented yet
You may try adding

// turn off any aux LED (s) when power is really low
#if defined(USE_INDICATOR_LED)
indicator_led(0);
#endif
#if defined(USE_AUX_RGB_LEDS)
rgb_led_set(0);
#endif
#ifdef USE_BUTTON_LED
button_led_set(0);
#endif

before the placeholder.

EDIT: upgraded the code
ADDED: Note that if the flashlight is on it will turned off when LVP fires. It needs to be checked whether turning it off won’t turn the aux LEDs back on.

Thanks, but i dont know how to do it, im not a coder.

Yes, and in an ideal world the ADC post-processing (averaging and decimation) would be separate from the rest of the code.

Edit: An obvious change would be to oversample the ADC readings instead of skipping three out of four ticks

Sensor lag time test results (all lights were programmed to shut off at 50 °C):



I managed to record the temperature reading of the internal sensor, this will help a lot for the further development of the ADC conversion code:

I think the aux leds do not need many amps. It can run on months with fresh batteries. So it would lasts a long time till the batterie is dead.
Many Aux-LEDs will turn off on low battery. This is implemented in some Aux-Boards from Lexel, such as MF01S or MF01 Mini or some Fireflies Flashlights.
Whithout this behaviour the LEDs will turn off because of the too low Voltage. This means they will use much less amps than with full battery.

But as Agro, it can be implemented to be on the safe side.
Otherwise the Low Battery-Indication on a MF01S or MF01 may not work as implemented, if the driver switches the aux-board off.

Fantastic! Via debugWIRE? I wonder how you managed to get the cables to the outside. Through the hole of the switch?

I insert short blips with a duration of the current temperature value and capture them with my luxmeter:

Awesome setup!

Indeed :slight_smile:

Not the red ones

Code is ready for review: https://bazaar.launchpad.net/~pakutrai/flashlight-firmware/fsm/revision/465

Link to the pull request: Merge into fsm : fsm : Code : Flashlight Firmware Repository

Hello

I have the same problem, that I cannot clone the repository.
I use the Bazaar Explorer.

What do I have to enter in “open url”:
this does not work for me: lp:~toykeeper/flashlight-firmware/fsm
I get the same errors as shown by Lexel’ screenshot.

Did you click the button with the green arrow on the left? The one that says “Quelldateien des Projektes von einem anderen Ort beziehen”? The buttons with the blue icons are probably meant to open local and not remote projects.

“lp:~toykeeper/flashlight-firmware/fsm” is the correct URL.

This does not work either. I use Windows 10 Pro.
Do I have to be registred at launchpad? And do I need that ssh key file?
see: Bug #1807226 “bzr: ERROR: httplib.IncompleteRead: IncompleteRead...” : Bugs : Bazaar

Run command: bzr branch lp:~toykeeper/flashlight-firmware/fsm “O:/Neuer Ordner (2)/trunk” —use-existing-dir
Qt: Untested Windows version 6.2 detected!
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See “bzr help launchpad-login”.

bzr: ERROR: httplib.IncompleteRead: IncompleteRead(34 bytes read)

Traceback (most recent call last):
File “bzrlib\commands.pyo”, line 930, in exception_to_return_code
File “bzrlib\commands.pyo”, line 1141, in run_bzr
File “bzrlib\commands.pyo”, line 673, in run_argv_aliases
File “bzrlib\commands.pyo”, line 697, in run
File “bzrlib\cleanup.pyo”, line 136, in run_simple
File “bzrlib\cleanup.pyo”, line 166, in _do_with_cleanups
File “C:/Program Files (x86)/Bazaar/plugins\qbzr\lib\commands.py”, line 826, in run
File “C:/Program Files (x86)/Bazaar/plugins\qbzr\lib\subprocess.py”, line 1011, in run_subprocess_command
File “bzrlib\commands.pyo”, line 1141, in run_bzr
File “bzrlib\commands.pyo”, line 673, in run_argv_aliases
File “bzrlib\commands.pyo”, line 697, in run
File “bzrlib\cleanup.pyo”, line 136, in run_simple
File “bzrlib\cleanup.pyo”, line 166, in _do_with_cleanups
File “bzrlib\builtins.pyo”, line 1434, in run
File “bzrlib\controldir.pyo”, line 780, in open_tree_or_branch
File “bzrlib\controldir.pyo”, line 689, in open
File “bzrlib\controldir.pyo”, line 718, in open_from_transport
File “bzrlib\transport\init.pyo”, line 1719, in do_catching_redirections
File “bzrlib\controldir.pyo”, line 706, in find_format
File “bzrlib\controldir.pyo”, line 1151, in find_format
File “C:/Program Files (x86)/Bazaar/plugins\git\init.py”, line 235, in probe_transport
File “C:/Program Files (x86)/Bazaar/plugins\git\init.py”, line 182, in probe_http_transport
File “socket.pyo”, line 348, in read
File “httplib.pyo”, line 522, in read
File “httplib.pyo”, line 565, in _read_chunked
IncompleteRead: IncompleteRead(34 bytes read)
bzr 2.6b1 on python 2.6.6 (Windows-post2008Server-6.2.9200)
arguments: [‘C:\Program Files (x86)\Bazaar\bzr.exe’, ‘qsubprocess’, ‘—
bencode’, ‘l6:branch37:lp:~toykeeper/flashlight-firmware/fsm25:O:/Neuer
Ordner (2)/trunk18:—use-existing-dire’]
plugins: bzrtools[2.5.0], changelog_merge[2.6b1], colo[0.4.0],
explorer[1.3.0dev], fastimport[0.14.0dev], git[0.6.8dev],
launchpad[2.6b1], loom[2.3.0dev], netrc_credential_store[2.6b1],
news_merge[2.6b1], pipeline[1.4.0], qbzr[0.23.0dev], rewrite[0.6.4dev],
svn[1.2.2dev], upload[1.2.0dev], xmloutput[0.8.8]
encoding: ‘cp1252’, fsenc: ‘mbcs’, lang: None

* Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https://bugs.launchpad.net/bzr/+filebug
including this traceback and a description of the problem.

[quote=hdw]
Do I have to be registred at launchpad? And do I need that ssh key file?[/QUOTE]No and no.

[quote=hdw]
This does not work either.[/QUOTE]Maybe give TortoiseBzr a try? Or use the command line directly.

[quote=0-8-15 User]

[quote=hdw]
Do I have to be registred at launchpad? And do I need that ssh key file?[/QUOTE]No and no.

Hello 0-8-15 User

I have to give it up. I tried over 5 hours to simply copy the repository.
Would you please be so kind to send me a zip-Copy of the current repository? That would be really great :slight_smile:

I woul send you a pm with my email-address.

[quote=hdw]

[quote=0-8-15 User]

Just go to one of the revisions you are interested in, for example:

https://bazaar.launchpad.net/~toykeeper/flashlight-firmware/fsm/revision/464

Then at the top choose “download tarball” and work with the files manually