As I developed my own 128-led strip RGB-encoder in the past, I would like to get some more info on how I would be able to integrate these into the Zynhian UI, as a replacement for the standard Zynthian kit encoders.
I have complete control over the firmware of these encoders, at the moment they work using I2C, where the level is reported (0-254) or the level is set by an I2C command.
Is it possible to use these with I2C? Do I need to use an interrupt pin to signal a turn/click, ā¦? Where in the Zynthian code should I start looking? Or is this simply some kind of configuration? If so, what is the expected/required behavior of an i2c encoder in Zynthian? Like I said, I can always adapt the firmware on my encoder to match what Zynthian needsā¦
zynrv112 => rotary analog encoder implementation (using Alpha RV112 as reference device)
zyncoder_i2c => it should be a i2c rotary encoder implementation, but itās outdated and not working for sure
Zynthian encoders/pots are purely incremental. I think the best option would be to expose the encoder device so zyncoder library can load it normally. If you prefer i2c , you should implement an i2c āzynpotā. You could use zyncoder & zyncoder_i2c as starting point.
For the led-feedback part, we have nothing like this implemented, but it shouldnāt be a problem to modify the zynthian_gui_controller for including an update call when value changes.
Ok, thanks for the guidance. I know my way around programming, but Iām not very familiar with building these things in Linux.
Do I just go ahead and start by cloning the zynthian/zyncoder repository on my Zynthian-box, start programming, building it?
How do I eventually install what I built using above step to be used by the Zynthian UI on my box to test it? Or is this automatically āactivatedā? Is it possible to perform some kind of unit tests on the encoder parts?
Very nice device! One, of course, presumes the LEDās are Tri Colourā¦?
Probably better to fork rather than clone the repository so that you have control of your own sub project at github ( You will need an account up there ).
You then use git tools to pull down your forked copy from your github repository and smash that around to your hearts content.
Iām presuming from the way you describe the process that you havenāt met git directly.
It has a VERY close relationship with linux as, they are projects initiated by the same guy.
It has itās characteristics, legend says it was written in a weekend, but it works and operates entirely peer to peer which seems to be the preferred model as weāve learnt over the past twenty or so years.
Actually running and developing code on a zynthian depends largely on your focus. I have only really ever submitted one Pull Request but have read and manipulated a great deal of zynthian code over the years, and Iāve found Visual Studio Code from Microsoft to be the most effective mechanism as itās an IDE and will handle many tasks around development in a very efficent and intelligent way.
For instance it will manage your github account, allowing you to pull and push code from your zynthian to the github repository. It will also allow you to debug remotely from another host, which all just works. If you have ever had to configure such an environment from scratch across frequently changing environments you will appreciate this.
If you know all this please forgive my presumption.
The led in the encoder is RGB, the 128 led ring is single color for the moment. Routing all these signals to these leds on a dual layer board was already a pretty PITA. Making these 128 leds rgb would be impossible with a two layer pcb I think.
I have a little bit of experience with GIT, but not a lot. For now I would just work on a local copy of the code, just to mess around a bit and see if I can get anywhere with it.
That is already ābuilt-inā. But it uses a lot of current then, 128 ledsā¦ Although I use a MAX6954ATL+ driving these 128 leds, and that chip should handle this a bit āsmartā, I get 400 mA when all leds are powered. (Full arc)
I donāt have the device at hand now, so not sure about exact dimensions. Of course, when you need to position 128 leds in a circle, you need a slightly bigger diameter
Are you using testing branch? You should because we are really close to release a new versiĆ³n and there is a lot of changes. Donāt waste your time with the stable branch.
The LEDs should be strobed to reduce current usage, i.e. do not power all at the same time. If done correctly the effect is not visible to the human eye but reduces current significantly.
Iāve done a bit of reading up on how to use GitHub passed weekend so I started now by forking the zyncoder:testing branch. I will work on that fork on a branch of my own. As I understood, the way to proceed is to do a Pull Request when my coding is done?
@jofemodo You mentioned zyncoder_i2c was outdated and not working for sure. Indeed, when trying to build this for zyncoder_test I saw missing functions. What should my approach be best like? Rewriting the zyncoder_i2c part or create a new one?
zyncoder_i2c is a driver for a bespoke i2c interface that I built. Details of an enhanced version are here. It was an unofficial hack that I did when I first started to use Zynthian. I made a very custom build which is now in a box somewhere and not used so I havenāt touched that code for a long time. There are others who used it as a basis for some other custom interfaces but I would suggest the code is at least obsolescent if not obsolete and we should deprecate it. There have been many changes to the Zynthian structure since that driver was last touched and I would imaging it is broken.
Note: Zynthian uses the Raspberry Pi I2C interface for many purposes. This specific driver was to interface with a particular I2C based device. Donāt be confused - it is not the main method of Zynthian interfacing with I2C devices.