Clinkt

Pi Larson ScanningI may have got a little carried away.

The Blinkt hat has a perfectly* good python library which does everything you might reasonably want to do with a set of 8 APA102 lights. My problem there is the word ‘reasonably’. So, I re-wrote it in C++, because my soul has never seen the light of day.

(* nearly perfectly. Some might say that flushing the visible buffer by writing white pixels off the end of it is a little much if you decide to define the number of LEDs as 6 for testing and OW MY EYES.)

It’ll take arbitrary pixel length, just like the python library, but unlike the python library it’s built with the assumption you’ll want to make and use multiple patterns, and manipulate those patterns with regard to each other. I can cross over patterns based on whatever input I like, as long as I painstakingly craft that input and sanitise it myself.

The reason I wanted to dig deeper than the python framework was that the Raspberry Pi is my lightweight development machine. I have a laptop that fits into a box. More on that in the next post.

I’m reliably informed that it’s against the law to have a blinkt and not use it to output something something pop culture Davis Hasselhoff – so here is the Larson Scanner in use: Video 19-04-2017, 14 00 28

The C++ library is available at https://github.com/dianaprobst/clinkt. You’ll need the bcm28somethingorother library, but the README.txt has that information. If you want to use cheerlights or APIs you’ll also need libcurl.

blinktenlights

I picked up a pimoroni blinkt in a swag bag recently, and I think I should make a colour clock out of it. There’s a simple one-liner for installation of all required libraries, but it pipes to bash.

That is against my religion. I like to know for myself how I’m messing things up. I like to make sure the checksums are right. Disappointingly, I did it through aptitude, and it didn’t go wrong /at all/.

Lasers

A while back I decided for safety reasons not to put laser cutting capability onto my Art Bot. So, the laser and heatsink bundle arrived today. I’m going to be messing with the voltage and current using a dummy load (also bought that, rather than scraping it together) and nothing could possibly go wrong.

I’ve already written the software.

C++: Cake or Death?

Oddly happy. I’ve got a program where if I run it in the debugger, it completes, and if I run it in the command line it segfaults. This pleases me obscurely.

Yes, I’ve checked it’s the same source file and the same build. No, I’m probably not going to dig into it, I’m just going to fix it and move onto the next problem. However, I’m pleased that I can build something that breaks, because it’s a good step on the road to building something that doesn’t break.

ETA: Wasn’t finding file to make it when edited either. Now is. Still no segfault though.

Oozi – I hate Oozi

I need to mess with the PID loop on the 3D printer. Right now it’s got about 12 possible temperature states in a look-up table, and that’s not enough. It needs 60, I think. The symptom is that the print never starts, and I believe that’s because the temperature never stabilises enough. If the change in loop doesn’t fix it, I’ll end up using an Arduino/Ramps combo, but I need to do this.

I’ve needed to do it for about five months now. I do not want to flash that damned thing Yet Again. For one thing, it’s been months since I have and I’ve forgotten most of the steps.

Update: Have accidentally ordered an Arduino Mega to go with the early RAMPS board I picked up. I was on eBay and it fell into my basket.

Coding project

I need a small coding project, that will let me practice more than just simple procedural problems, but is not so massively complicated I die of it. I also, let’s be clear here, need sleep, food, and to remember what the inside of a bathtub looks like. Nevertheless, I’m looking for things in about that order.

I don’t know enough to know what an ideal project would be, which is making this hard.

Hollow Victory

I recently decided I needed to be able to convert raster images to vectors in my software so I could drive Itchy the Artbot. I looked up OpenCV as a way of comprehending computer vision, because it was the only thing I had heard of.

Apparently ‘vector’ and ‘std::vector’ are different things.

This was an error of ignorance that I could only put right once I’d learned enough C++ to feel I could go back to the OpenCV help files. So, I spent a month getting to the point where I could find out I shouldn’t waste time on this. Fucksake.

The latest in Yak Depilation

Sometimes, I find I no longer know the original ‘I need to wash my car’ incident or problem for which I am now shaving yaks. Here, I believe it is ‘I want to improve my drawing machine’.

  • So I have to be able to interact with the visuals, programatically; OpenCV looks good. But OpenCV is hard to use, because it’s powerful.
  • So, I need to be able to write software.
  • And if I go at a project this size I will just bounce off, so I need a smaller project first.
  • Project Euler exists, and the maths is relatively easy within the scope of what I can learn. Converting the maths to code is hard, though.
  • I need to learn how to handle big numbers, and #include BigInt.h is cheating.
  • So here I am, learning how to write bigint.h
  • Which means as this pdf isn’t easily readable that I’ll have to print it out
  • Hence, I’m trying to make CUPS work so I can print

There is nothing that can be said in favour of this plan, except that it will be a really well shaved yak when I leave it to go back up the list of items. Fortunately, attempting to make my print server actually print is always enough to pull me up and make me reconsider my life.

  • So, here I am on the Epson website, buying ink…

Itchy: Servo

Well, the big servos didn’t work, but nothing melted. The small ones do work. And, even better, I made someone tell me my electronics made god cry. I was using my LED array instead of an oscilloscope – it’s quick, and I only wanted to know where a signal was, not what it was. So hah!

Related: I really need to set up a proper connection to the oscilloscope on my main laptop.