priyadi / keyboard-firmware

Firmware of my keyboards
3 stars 0 forks source link

How can I get in contact with you re: WS2812 support for Promethium? #1

Open Ptomerty opened 7 years ago

Ptomerty commented 7 years ago

Hey! I had some questions regarding your use of light_ws2812 in QMK, as you are the only person to have implemented individual RGB LED support.

  1. Why do you call rgbsps_send() sometimes, e.g. this method, but not other times (here)?

  2. What's the reasoning behind making your LED arrays PROGMEM? (here)

Do you have a preferred method of contact? Discord, Reddit, or can I just ask my questions here?

Thanks a lot!

priyadi commented 7 years ago
  1. I assume because rgbsps_send() is going to be called elsewhere. rgbsps_send is the function that actually sends instruction to the LED bus, and it is expensive. It would block 4 micro seconds to set up all the LEDS. So I was making sure the instruction only get sent once.

  2. PROGMEM stores the data in flash memory along with application data, so it saves RAM.

On Saturday 01 July 2017 23:30:50 Ptomerty wrote:

Hey! I had some questions regarding your use of light_ws2812 in QMK, as you are the only person to have implemented individual RGB LED support.

  1. Why do you call rgbsps_send() sometimes, e.g. this method, but not other times (here)?

  2. What's the reasoning behind making your LED arrays PROGMEM? (here)

Do you have a preferred method of contact? Discord, Reddit, or can I just ask my questions here?

Thanks a lot!

Ptomerty commented 7 years ago

Hey, I'm back with a question.

How did you power your LEDs? Data I've found on the WS2812s suggest that they can use up to 60mA / unit, and light_ws2812 has no brightness/PWM settings. How did you make it so that you could power this off of a normal 500mA port? Or do the SK6812minis just consume a lot less power?

priyadi commented 7 years ago

I don't use more than 0x0F per channel per LED, out of possible 0xFF. That's 1/16 of maximum possible brightness. That seems to lower power requirement to fit way below the power supplied by USB. I'm using battery, so I still need some headroom for charging. Even with battery charging, I think I can still raise the limit to 0x1F or maybe even 0x3F.

With 0xF max, they are still bright enough for me even in daylight.

On the other hand, smooth LED effects are not possible, as I only have 16 level of brightness.

On Tuesday 04 July 2017 10:02:55 Ptomerty wrote:

Hey, I'm back with a question.

How did you power your LEDs? Data I've found on the WS2812s suggest that they can use up to 60mA / unit, and light_ws2812 has no brightness/PWM settings. How did you make it so that you could power this off of a normal 500mA port? Or do the SK6812minis just consume a lot less power?

priyadi commented 7 years ago

That's definitely toolchain problem. Try compiling demo app from light_ws2812 library and see if you can successfully do it: https://github.com/cpldcpu/light_ws2812

On 30/07/17 04:56, Ptomerty wrote:

Sorry for the very late bump.

I've gotten all my parts and have been working at QMK, using your files as a basis; however, they refuse to compile and link ws2812.h.

|john@johnpc:~/qmk_firmware$ make macropad Making macropad with keymap default avr-gcc (GCC) 4.9.2 Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiling: keyboards/macropad/keymaps/default/keymap.c [OK] Linking: .build/macropad_default.elf [ERRORS] .build/obj_macropad_default/keyboards/macropad/keymaps/default/keymap.o: In function led_off': /home/john/qmk_firmware/keyboards/macropad/keymaps/default/keymap.c:36: undefined reference torgbsps_set' .build/obj_macropad_default/keyboards/macropad/keymaps/default/keymap.o: In function led_set_layer': /home/john/qmk_firmware/keyboards/macropad/keymaps/default/keymap.c:46: undefined reference torgbsps_set' /home/john/qmk_firmware/keyboards/macropad/keymaps/default/keymap.c:47: undefined reference to rgbsps_set' /home/john/qmk_firmware/keyboards/macropad/keymaps/default/keymap.c:48: undefined reference torgbsps_set' /home/john/qmk_firmware/keyboards/macropad/keymaps/default/keymap.c:51: undefined reference to rgbsps_set' .build/obj_macropad_default/keyboards/macropad/keymaps/default/keymap.o:/home/john/qmk_firmware/keyboards/macropad/keymaps/default/keymap.c:52: more undefined references torgbsps_set' follow .build/obj_macropad_default/keyboards/macropad/keymaps/default/keymap.o: In function led_set_layer': /home/john/qmk_firmware/keyboards/macropad/keymaps/default/keymap.c:118: undefined reference torgbsps_send' collect2: error: ld returned 1 exit status tmk_core/rules.mk:285: recipe for target '.build/macropad_default.elf' failed make[1]: [.build/macropad_default.elf] Error 1 Makefile:498: recipe for target 'macropad' failed make: [macropad] Error 1 Make finished with errors |

I assumed this was due to rgbsps.c not being compiled or linked, and modified the location of ws2812.h, resulting in:

|In file included from rgbsps.c:1:0: ../../drivers/avr/ws2812.h:26:20: fatal error: avr/io.h: No such file or directory #include <avr/io.h> ^ compilation terminated. |

|avr-gcc| and |avr-libc| are both installed and fully updated. Have you encountered this error before, or have any idea on how to solve it?

Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/priyadi/keyboard-firmware/issues/1#issuecomment-318862251, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDRdbVUwvwibx-pGYmgBgZzpo3oCqZkks5sS6qngaJpZM4OLcYo.

Ptomerty commented 7 years ago

Hey, yeah it ended up being a toolchain problem.

Again sorry for asking questions, but I've encountered a more serious problem. I've managed to get most of my functions working, except for the RGB functions...

See code here: https://github.com/Ptomerty/qmk_firmware/tree/master/keyboards/macropad2

Currently everything is set up to go off when RGBSPS_ENABLED is defined; however, when I do so, everything stops working; even the keyboard itself. I'm afraid that the wires I soldered between the LEDs ended up shorting out somehow on the PCB, but crossing my fingers that it's a software problem. Do you see anything wrong with the code?

Thanks a lot!