social.tchncs.de is one of the many independent Mastodon servers you can use to participate in the fediverse.
A friendly server from Germany – which tends to attract techy people, but welcomes everybody. This is one of the oldest Mastodon instances.

Administered by:

Server stats:

3.7K
active users

#neopixel

1 post1 participant0 posts today

Another #NeoPixel project, another abstract clock. Well, just a timer for now until I get an RTC sorted.

I have a #TM1637 6-digit 7-segment LED display and a pair of #NeoPixel rings representing elapsed time.

The outer 24 LED ring uses red to show hours, and blue to show twentieths of a second. The inner 12 LED ring shows minutes in green and seconds in blue, each one a step of 5.

Running on an Arduino Pro-mini... because I could not get the NeoPixels to behave with any library on an #Uno R4!

Saw this project on #Instructables from #Moononournation instructables.com/IoT-Emoji-Si
It's a fun project, but I was more interested in the 8x8 #Neopixel #Matrix
So I bought a couple of the #Waveshare #ESP32S3 8x8 boards, and printed out a couple of cases.
The boards work really well - I had an idea in mind when I ordered them, but now I forgot what I wanted to do with them.... I guess I'll make an #emjoi #display after all..... LOL

Forbidden Planet “Krell” Display – MIDI CC Controller – Part 2

This revisits my Forbidden Planet “Krell” Display – MIDI CC Controller using my Forbidden Planet “Krell” Display PCB with a Waveshare RP2040 to create more of a “all in one” device.

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

If you are new to Arduino, see the Getting Started pages.

Parts list

PCB

This requires a built of the Forbidden Planet “Krell” Display PCB with the following:

  • 2 potentiometers
  • MIDI IN and OUT

I’ve used potentiometers that are their own knob, as they only poke through the casing by around 5mm or so.

If it you are able to get longer shaft pots, then that would probably be worthwhile.

Updated 3D Printed Case

This requires the following from the Krell Display 3D Printed Case:

This requires the following options in the OpenSCAD code:

show_frame = 1;
show_quadframe = 0;
show_insert = 1;
show_support = 0;
show_quadsupport = 0;
show_eurorack = 0;
show_eurorack_support = 1;

alg_pot1 = 1;
alg_pot2 = 1;
alg_cv = 0;

The frame does not really take into account the PCB at present, but I’ve reached the “good enough I want to do something else” stage, so I’ve just added a couple of small cut-outs (using a hacksaw) for the two MIDI sockets, and am content that the components stick out a bit from the back.

This cutout has to be 10.5mm from the end, 6mm wide, and 5mm deep.

At some point I might go back and design a deeper frame that has the cut-outs included and some kind of snap-on back to make it a self-contained box.

But for now, this is left as an exercise for, well, anyone else 🙂

Construction

I’ve used four brass 6mm spacers to screw into the mounting holes in the frame. Then the PCB can be inserted, taking care to squeeze in the 3D printed support around the LEDs and pots, and fixed with 20mm spacers which will also act as “legs”.

The Code

I’ve used a Waveshare Zero RP2040 and Circuitpython for this build. This is a combination of some of the test code used for the Forbidden Planet “Krell” Display PCB but with added MIDI.

The code supports both Serial and USB MIDI.

I wanted an equivalent of the Arduino map() and constrain() functions and didn’t immediate spot them in Circuitpython so wrote my own:

def algmap(val, minin, maxin, minout, maxout):
if (val < minin):
val = minin
if (val > maxin):
val = maxin
return minout + (((val - minin) * (maxout - minout)) / (maxin - minin))

This allows me to map the analog read values (0 to 65535) down to MIDI CC values (0 to 127) whilst also allowing for some inaccuracies (I’ve treated anything below 256 as zero for example):

alg1cc = int(algmap(alg1_in.value,256,65530,0,127))

I’ve used the Adafruit MIDI library, which I’m still not really a fan of, but I wanted to include MIDI THRU functionality to allow the controller to sit inline with an existing MIDI stream. But it doesn’t seem to work very well.

I was already only updating the LEDs/MIDI CC if the pot values had changed, to cut down on the number of Neopixel writes required.

I experimented with changing the scheduling of the analog reads and MIDI but that didn’t seem to help very much. In the end I made sure that all MIDI messages queued up in the system would be read at the same time before going back to checking the pots.

    msg = midiuart.receive()
while (msg is not None):
if (not isinstance(msg, MIDIUnknownEvent)):
midiuart.send(msg)
msg = midiuart.receive()

It will do for now. Moving forward, I might try the Winterbloom SmolMIDI library. If that still doesn’t give me some useful performance then I might have to switch over to Arduino C.

Find it on GitHub here.

Closing Thoughts

The MIDI throughput is disappointing, but then I’ve never really gotten on with the Adafruit MIDI library. I use it as USB MIDI on Circuitpython is so easy, so will need to do something about that.

I’m still deciding on the PCB-sized supports too. The original seemed to have nicer diffusion of the LEDs, but that could have been the difference between 5mm SMT neopixels and these THT APA106s which seem more directional in the first place.

And I really ought to finish the 3D printed case properly too.

So this is “that will do” for now, but I ought to come back and finish it off properly at some point.

Kevin

I have hit a tough spot in an existing project, so while I think about it, how about a distraction project!

Behold a NeoPixel clock ⌚

An abstract (to me) clock using 2 NeoPixel rings to indicate the time using the position and colour of the pixels.

I added a TM1637 based 6-digit 7-segment display too, because it was on the table beside me, and why not?

More ideas to implement, but pleased with it so far.

All the code on GitHub. Enjoy!

github.com/ilneill/NeoPixelClo

#Arduino
#NeoPixel
#TM1637

Having some #NeoPixel fun!

It is incredibly simple to write code for these things, even with just a small #Arduino.

Here I have 2x 12 RGB pixel rings, one daisy chained from the other. Just tell the library you have 24 pixels and you are off to the races.

It draws rings and the infinity symbol in a variety of colours controlled by some nested RGB loops.

Ended up doing a bit of Arduino coding as my soldering gear was not returned as expected... Some excuse about the cold 🤔

In truth, it has not got above freezing all day, and even the cat did not venture out.

Anyway, behold some NeoPixel goodness. Literally 10 mins coding on the Adafruit "simple" Library example.

#Arduino
#coding
#neopixel

I've never done anything like this so I was proud it worked. It's a #RaspberryPi Zero 2 W, I soldered on the headers myself and then soldered the cables to the #NeoPixel Ring. I wrote a small script in #Python to handle changing colors and to turn off the ring. I'm going to #3DPrint a small stand to put under my 1.5gal fish tank and will place the ring within the stand. I'll be sure to update this with a video of that but here's what I have so far!

Der 5. Workshop "Programmieren lernen mit Arduino" findet am Donnerstag 21.11. um 19:00 im #ZTL statt.

Endlich - smarte RGB-WS2812 Neopixel LEDs! Wir erfahren, wie sie funktionieren und setzen für die Ansteuerung die FastLED-Bibliothek ein. Als Belohnung gibt's dann noch ein kleines Reaktionsspiel zum Testen der Reflexe und Hand-Auge-Koordination

#ztl #ztlspace #zentrumfürtechnikkultur
#makerspace #arduino #programmieren
#landau #WS2812 #neopixel #FastLED