|
Author |
Message |
Easy-X |
This post is not being displayed .
|
 Easy-X Super Spammer

Joined: 08 Mar 2019 Karma :   
|
 Posted: 00:09 - 09 Apr 2025 Post subject: Arduinos and Picos |
 |
|
I've been fiddling with microcontrollers on and off since the days of the PIC chips. "Back in the Day" they were handy for memory copiers when PAYG credit was still stored on the phone
Anyhoo, I missed the Raspberry Pico on release and now they're onto a Mk2 with optional WiFi!
https://shop.pimoroni.com/cdn/shop/files/PICO_2_W_768x768_crop_center.png?v=1732295828
I mentioned in the "what have you bought" thread I had a hankering to recreate an old vacuum-fluorescent-display calculator and tonight I've had some success, the first step on the path:
https://i.imgur.com/B5nYrpF.jpeg
The digits were created in our old friend, MS Paint, and the image converted into source code, something like this:
Code: | #define CUSTOM_WIDTH 38
#define CUSTOM_HEIGHT 56
static uint8_t customimage[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFC... |
And then the image is written to the display by copying the array into the framebuffer. Next I need to get all three displays working simultaneously. That'll give me a limit of 999,999,999 so no use to Elon Musk to work out how many billions he's lost but the cool thing is you can just re-write the code to have smaller digits and more per display if needed. ____________________ Husqvarna Vitpilen 401, Yamaha XSR700, Honda Rebel, Yamaha DT175, Suzuki SV650 (loan) Fazer 600, Keeway Superlight 125, 50cc turd scooter |
|
Back to top |
|
You must be logged in to rate posts |
|
 |
Easy-X |
This post is not being displayed .
|
 Easy-X Super Spammer

Joined: 08 Mar 2019 Karma :   
|
 Posted: 21:01 - 14 Apr 2025 Post subject: |
 |
|
Made a bracket for the three displays from acrylic. My top tip for heating and bending acrylic is not stand there like a plank for 15 mins with the heatgun, thinking you have it on the highest setting when actually you have it on the lowest
https://i.imgur.com/lBhhhFG.jpeg
Anyhoo, the bracket will be bolted to a "gaming" keypad. Gaming just means it uses a modern interpretation of mechanical switches. Originally the switches were on a PCB and eventually off to USB. I've gone with the direct approach and wired a 4x6 matrix instead.
https://i.imgur.com/FaMY6IN.jpeg
A matrix system works by having 4 output lines and sending a pulse down each one in turn. If a signal is seen on any of the 6 input lines you can say "switch at X1 Y2 has been pressed therefore I'll output the digit seven".
I also got the 3 displays working together. I now have to decide whether I display a complete image for each digit, e.g. "8" loads a matching bitmap, or instead make a composite out of relevant segments. Digits 0~9 and again with the decimal point is 20 images whereas a composite is 7 segments + DP but the extra code to say "7" = segments a, b, c. ____________________ Husqvarna Vitpilen 401, Yamaha XSR700, Honda Rebel, Yamaha DT175, Suzuki SV650 (loan) Fazer 600, Keeway Superlight 125, 50cc turd scooter |
|
Back to top |
|
You must be logged in to rate posts |
|
 |
WD Forte |
This post is not being displayed .
|
 WD Forte World Chat Champion

Joined: 17 Jun 2010 Karma :   
|
|
Back to top |
|
You must be logged in to rate posts |
|
 |
A100man |
This post is not being displayed .
|
 A100man World Chat Champion

Joined: 19 Aug 2013 Karma :   
|
 Posted: 09:29 - 15 Apr 2025 Post subject: |
 |
|
Easy-X wrote: | Made a bracket for the three displays from acrylic. My top tip for heating and bending acrylic is not stand there like a plank for 15 mins with the heatgun, thinking you have it on the highest setting when actually you have it on the lowest
https://i.imgur.com/lBhhhFG.jpeg
Anyhoo, the bracket will be bolted to a "gaming" keypad. Gaming just means it uses a modern interpretation of mechanical switches. Originally the switches were on a PCB and eventually off to USB. I've gone with the direct approach and wired a 4x6 matrix instead.
https://i.imgur.com/FaMY6IN.jpeg
A matrix system works by having 4 output lines and sending a pulse down each one in turn. If a signal is seen on any of the 6 input lines you can say "switch at X1 Y2 has been pressed therefore I'll output the digit seven".
I also got the 3 displays working together. I now have to decide whether I display a complete image for each digit, e.g. "8" loads a matching bitmap, or instead make a composite out of relevant segments. Digits 0~9 and again with the decimal point is 20 images whereas a composite is 7 segments + DP but the extra code to say "7" = segments a, b, c. |
This strikes me as more of a long winter nights project.. ____________________ Now: A100, GT250A, XJ598, FZ750
Then: Fizz, RS200, KL250, XJ550, Laverda Alpina, XJ600, FZS600 |
|
Back to top |
|
You must be logged in to rate posts |
|
 |
WD Forte |
This post is not being displayed .
|
 WD Forte World Chat Champion

Joined: 17 Jun 2010 Karma :   
|
 Posted: 14:17 - 17 Apr 2025 Post subject: |
 |
|
Just ordered a couple of the Pico2 W's with headers so I can plug em in the breadboards and fuck about them
I'll do that "hello world" program first cos it'll look good on me CV for
when I apply for job at CERN.
That and me Crapnav will get me a bucket and mop job for sure
https://imgur.com/gV9lJT0.jpg ____________________ bikers smell of wee |
|
Back to top |
|
You must be logged in to rate posts |
|
 |
Easy-X |
This post is not being displayed .
|
 Easy-X Super Spammer

Joined: 08 Mar 2019 Karma :   
|
 Posted: 22:22 - 21 Apr 2025 Post subject: |
 |
|
All of the parts are roughly assembled:
https://i.imgur.com/OPV5VHM.jpeg
Bit of a shambles but it all seems to work:
https://i.imgur.com/e6fJVcx.jpeg
Generic RP2340 board (Pico 2 knock-off)
4x6 matrix switch lines
2x I2C busses - two displays on bus 0, one on bus 1
A blue "status" LED for no particular reason but to fill the old Numlock space
USB extended to a socket on the side
I did also intend to fit a LiPo pack but with the wiring there really is no space available for one of any reasonable size.
Time to get the code together. So far I have code for the OLED displays and the status LED. Just need something for the matrix switches in C. I tried Python and didn't like it much. The very first "business class" language I ever learnt was C, 37 years ago  ____________________ Husqvarna Vitpilen 401, Yamaha XSR700, Honda Rebel, Yamaha DT175, Suzuki SV650 (loan) Fazer 600, Keeway Superlight 125, 50cc turd scooter |
|
Back to top |
|
You must be logged in to rate posts |
|
 |
WD Forte |
This post is not being displayed .
|
 WD Forte World Chat Champion

Joined: 17 Jun 2010 Karma :   
|
|
Back to top |
|
You must be logged in to rate posts |
|
 |
Easy-X |
This post is not being displayed .
|
 Easy-X Super Spammer

Joined: 08 Mar 2019 Karma :   
|
 Posted: 21:04 - 22 Apr 2025 Post subject: |
 |
|
The board I'm using has a socket and charging circuit - LiPo-ready - it'd be tricky physically fitting even a flat pack in. The jumble of wires at the top (in the picture) is where I might have fitted something. I could halve the number of wires by daisy-chaining more stuff together but that would have to happen outside the case, just behind the displays.
At the end of the day it's an elaborate desk ornament so USB power and lack of portability aren't an issue. Plus it saves me writing some sort of sleep and wake battery preserver  ____________________ Husqvarna Vitpilen 401, Yamaha XSR700, Honda Rebel, Yamaha DT175, Suzuki SV650 (loan) Fazer 600, Keeway Superlight 125, 50cc turd scooter |
|
Back to top |
|
You must be logged in to rate posts |
|
 |
Easy-X |
This post is not being displayed .
|
 Easy-X Super Spammer

Joined: 08 Mar 2019 Karma :   
|
 Posted: 00:29 - 24 Apr 2025 Post subject: |
 |
|
A little summary for anyone wanting to get into the whole microcontroller thing...
The biggest changes I've encountered getting back into the scene is the variety of ways you can program the things. The electronics side - wire up an LED and resistor to Pin 23 - is mostly the same. That being said, there are also a lot more "plug and play" modules negating the need for a soldering iron if for example you have youngsters wanting to tinker.
Anyhoo, the code. People rarely bother with assembly anymore but C is still a thing. Newer/higher-end devices go as far as C/C++. If you're not much of a coder MicroPython and CircuitPython are very easy going. C/C++ is the new "low level, access the bare metal" zone whereas Python is the user friendly equivalent of BASIC found on old 8-bit computers.
With C/C++ you're usually reflashing the whole device whereas Python is pretty much loaded as an operating system and you send over the source code file (via USB, serial, debug or even WiFi) and the interpreter runs it straight away.
Writing the code can be done with just a text editor and command line utilities if you're a purist/masochist or there's VS Code which has extensions for both C/C++ and both Python variants. It's a bit intimidating for a beginner though.
Alternatively, "Arduino IDE" is fairly simple for writing C code but will program almost any device. Examples of Python editors: "Thonny" for MicroPython on a Pico and "Mu Editor" for CircuitPython. You can even program CircuitPython via a web browser! There are many, many ways to get things done of course, I'm just mentioning stuff you should immediately stumble across.
With regards to hardware, there's the previously mentioned Pico and Pico 2. The former is yet another Arm iteration (Cortex-M0+) but the latter also packs open source RISC-V cores alongside a Cortex-M33. ATmega - the name often associated with "Arduino" - also churn out Cortex variants. The new kid on the block (relatively speaking) would be the ESP32. Usually these have WiFi and Bluetooth built in and later variants have RISC-V cores. There's quite a bit of feature overlap/convergence so adapting code and projects from one device to another is quite common.
And projects there are aplenty. It doesn't really matter where you start from - complete noob to grizzled embedded developer - someone somewhere has already written up an article about... almost anything you can probably think of! ____________________ Husqvarna Vitpilen 401, Yamaha XSR700, Honda Rebel, Yamaha DT175, Suzuki SV650 (loan) Fazer 600, Keeway Superlight 125, 50cc turd scooter |
|
Back to top |
|
You must be logged in to rate posts |
|
 |
|