Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flashlight app? #8

Open
Pescatore04 opened this issue May 4, 2021 · 1 comment
Open

Flashlight app? #8

Pescatore04 opened this issue May 4, 2021 · 1 comment

Comments

@Pescatore04
Copy link

I don't know how to code this and it goes against all the power saving efforts for such wearable. However, turning on all pixels white at low intensity might be a useful light source.
IIRC, there is a fixed pull-up for the backlight, so adding a LED controller, or via PWM would provide a settable intensity.

@BenjaminSchlechter
Copy link

That's a great idea and to get started developing apps for the osw i decided to implement this.

For the intensity i set the default to max as the display isn't emitting as much light as a lamp - however for indoor usage at night i think it's good enough. I haven't digged into the hardware/PWM thing and just used the software HAL (hardware abstraction layer), i.e.: hal->setBrightness(255);

With Button 2/3 you can change the color (default behaviour) or the intensity (use '#define CHANGE_COLORS_INSTEAD_OF_BRIGHTNESS 0' in your config.h). Of course the display intensity is restored to it's previous state when switching to the next app/watchface. With the color changig mode this watchface can be used to detect dead pixels as well.

I didn't want to fork the repo and make a proper pull request, therefore i made a patch for anyone to use (which github doesn't allow as attachment...): Therefore unzip the patch in your open-smartwatch-os repo directory, apply it with git apply OswAppLamp.patch and add '#define TOOL_LAMP 1' to your config.h file in the include/ subdirectory. Then you're ready to go (which means running 'pio run -t upload' of course).

The patch:
OswAppLamp.patch.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants