100 Days of Code Day 71
I am getting some easier exercises out of the way today. C# got Swift Scheduling, and Javascript got Atbash Cipher. Of course yesterday’s .net upgrade that broke all my projects required downloading a new visual studio community & .net runtime today (groan). POV on the C# track is marked hard. So to make room for it I also did micro-blog, which I way over complicated, on the Javascript track.
I also needed to fix RollTheDie on the C# track. The test cases changed and it stopped working. I had an off by 1 error on the Random.Next call, I guess it goes from start to end-1 instead of start to end.
I had something fun planned for yesterday. No time yesterday, so lets do it today! Turns out, it wasn’t quite as fun as I hoped, but it is still very cool. Fun was neutered by problems.
Anyway on to the fun. A week or two ago, I ordered a trio of small OLED displays (they didn’t want to sell just one). To get it up and running I decided to head over to Chapter 11 of “Programming the Pico – Second Edition” by Simon Monk. I didn’t have an OLED to test last time I was reading it. Now I do.
Problems:
- The book expects a SSD1306 OLED display and I have a SH1106. I thought I got the right one but I guess not.
- The I2C did not want to work. It finally worked once I fixed a parameter by referring to it as pull instead of Pull (rookie mistake).
- I don’t have drivers for the SH1106. I thought the SSD1306 stuff would work but nope or at least I couldn’t get it working. Instead I trolled around looking for drivers and downloaded one from GitHub (thank you Robert HH). Then I had to figure out how to install it (turns out open the .py file in Thonny and save it in the lib directory on the pico).
- Apparently Pins 4 and 5 don’t want to work, but Pins 26, and 27 are ok with it.
- I am not sure the Pico was pushed into the breadboard well enough.
That’s a lot of problems which killed a lot of the fun. I wish I read ahead and found the i2c.scan() call to see if the address was wrong. I was trying to follow a C++ arduino script to detect that. (Yes I went down many unfruitful rabbit holes.) Anyway I didn’t want to do just one example so I did the next example too, a digital clock. Now that it is working I guess it was fun or at least the clock was. The next example is for a neo pixel device, so I am on my own if I want to make something cool with the OLED. Do you think I could make a small video game?
