Thursday, April 15, 2021

Development - LED Control #1

After crashing the entire PIC32 firmware with an innocuous change ("I did not touch that piece of code!") that hung me up for a few days, I made progress today.  I appear to be able to control all 9 of the LEDs that are connected to the LP5569.  Have not tested all of the slots, but the five I have tested all work correctly.  As an added bonus I can set them from the Android APP and change them on the PC and vice a versa.  And the innocuous change cleanup has also improved the serial interface between the PIC32 and the BT module.  Thus for now it all works as planned.  As an unforeseen bonus, I have managed to keep the BT messages down to 32 bits for now.  

My next task is the Android GUI.  On the PC, screen space is almost limitless, but this is not true on a phone.  I started by expanding the design of the original GUI.  One block of controls (radio buttons) that select/show the state of each LED.  But on the smaller phones I have, 10 did not fit, I only had four LEDs  before.  I suppose I could reduce them down some more, but then any one with fingers bigger than a baby would have a hard time selecting the correct radio button.  The two images below show the screen.  The second image shows the screen scrolled up to reveal LED 10, which is controlled differently than the other 9. Direct PIC control instead of I2C to the LP5569.


 This format does not allow for the brightness value (PWM setting) of the LED, which can be applied to the ON, BURST, CYCLE states.  This is a value from 1 to 100.  On the PC this is done with a slider.  I will probably only use steps of 10 for this.  When I first tested this, there was no discernible change intensity with steps less than 10.

One of the ideas I am thinking about is to place the status of all 10 LEDs (state and brightness value) down the right side.  Touching on the display over an LED Status will cause a single display similar to one of the above along with a slider to appear on the left side.  You can then set the new state and change the brightness value.  

While this idea will take less screen space, it does not provide the quick access that the current format does (multiple presses vs one press).  But you get it all LEDs on one screen with no scrolling.  I guess I need to prototype this out and see how it looks and performs.



No comments:

Post a Comment