Does anybody know a way to test a UI on the computer before flashing it to a light? I am think something along the lines of using a keyboard botton as the switch input, and getting the data values back on display.
I am working on a custom UI for my KR4. It would just be easier to run through prototyping on the computer and make sure everything is working how I want to before reflashing my light. I feel like I will probably have to compile and run at least 5 times before I have something that boots up and runs bug free, let alone a good ui that works for me…. I also don’t have the snazzy pogo pin thing for flashing, so it would save me some work soldering and desoldering.
I’ve found something! Tinkercad by auto desk does circuit simulation, with code integration for micro-controllers such as Arduino and attiny. It seems if we just made a cad mock up of the driver circuit, we could easily test our UIs in tinker cad with a simulated lightoutput and everything.
Anybody want to test this? Ill try find a schematic and see if I can build the driver circuit and test it with a known software.
I have a small test bed on which I have a cell holder, a switch, a driver, and an LED hooked up on a board. I can connect (solder) in a driver and change the led, switch, and cell if desired at will.
That’s a cool idea Don, I might have set something like that up. Then at least I could test it without desoldering and assembling the light every time. Could the aux leds be simulated with 1 RGB emitter and the main leds with 1 emitter?
I’ve done some debugging with simavr and simulavr, but it’s much easier to just run it on real hardware because you have to simulate all input as well.
You don’t. That’s the problem. You load the firmware, connect with gdb and start the execution. Then it will do all kind of strange things, because the real hardware is missing. When it wants to read an ADC value, you set a breakpoint/expression and return the value it should read. Same for the button: If you want to press it, it is easier to emit the event yourself because you can’t change the digital input value with the right timing manually. “LED brightness” can be seen by reading the PWM registers or reading variables at the right time. Debugging firmware without the hardware is always a big mess.
This setup reads like it's what I've long wanted to do. If doing so is not an imposition, would you be willing to take some photos of your layout, including straight overhead with labels of anything that might not be easily recognizable?
Then either post the photos within this thread or send them by PM. I would be extremely grateful for your consideration, with complete understanding if it's not convenient! Thanks!
Thanks for the ideas everyone. I’m not willing to waste any resources getting things I will in all likelyhoodnly use one time. I will probably tear my kr4 down and set it up as a testing station until I’ve got everything dialed in.