Sample code for rotary encoder handling that I've found seems to double step with my encoder. I guess there's other that have half steps or something. Anyhow, here's how I've been doing it and it's working just fine.
"""Interrupt handler for rotary encoder falling edge"""
global frequency
if DTPin.value() == 1:
frequency += int(math.pow(10, step_power))
else:
frequency -= int(math.pow(10, step_power))
setFrequency(frequency)
So, the interrupt triggers just on the falling edge of the clock pin and then looks to see if the data pin is high (for clockwise) or low (counter-clockwise).
Recently, I've been enjoying developing embedded projects on an RP2040 zero board using MicroPython. The RP2040s are fast and cheap and the zero board is much more compact than the Pi Pico but has more than enough I/O for my needs. (Actually, all the I/O is there if you need it).
MicroPython is a wonderful language and I like the fact that the source code is on the device so I can always find it again.
The normal way to develop MicroPython is Thonny. It's fine but the editor is rudimentary compared the modern code editors with completion and AI suggestions.
Recently I've discovered the MicroPico extension for VSCode and it is working pretty well.
The environment does all the things I need including showing the files on the board, letting me run the current file, stop it, and use the REPL console.
Most impressive is the AI code completion which often stuns me with its guesses about what I was about to type. (The suggestion is the italic stuff after time. below).
MicroPico doesn't do the firmware install but that's quite easy on the RP2040 (hold the boot button and plug in).
The files stored on the device are shown in the "Mpy Remote Workspace" area on the left and a project folder is above. You can drag files up or down between areas but it moves the file. To copy a file on macOS you option-drag as is the normal convention here.
I wish single step debugging was available for MicroPython but if I'm debugging pure python algorithmic code it can be debugged locally if needed.
There are other MicroPython extensions for VSCode but this one seems to work quite well for me.
As part of my objective to take the SolderSmoke DC receiver forward to be a double sideband transceiver I've been messing about with an Si5351 based VFO. The CPU is an RP2040 Zero board which I program in Micropython. I've just bought a couple of these handy boards that include a 1.3 inch OLED display, a rotary encoder and two extra push buttons.
No documentation comes with it but the edge pins are nicely labeled on the back.
When I hooked it up and tried my existing code, written for an SSD1306 OLED, the display showed mostly noise. It turns out the boards with a larger, 1.3 inch, display require the SH1106 driver which I found here. Both drivers subclass the Micropython Framebuffer class which is a very interesting thing in its own right.
The display / encoder board has nice big mounting holes on the corners as you can see.
I paid AU$6.79 each for the larger display version on AliExpress. For you in America I guess they'll be about $100. ;-) The board seems to be widely available and is called "0.96/1.3-inch OLED Display Module With Button EC11 Rotary Encoder IIC Interface LCD Screen"
I've seen an OSError stack trace when trying to talk to an I2C device on the wrong address and wondered what EIO means. It would be nice to have a list of all the error codes and what they mean.
From what I've read, error numbers are different for each hardware port of MicroPython. I'm using a Raspberry PI PICO and can get a list like this:
MicroPython v1.24.1 on 2024-11-29; Raspberry Pi Pico with RP2040
Cyber criminals were able to breach a number of super funds, stealing hundreds of thousands of dollars from members. The breach was unsophisticated, and likely came about because some super funds had not implemented basic security protocols on members' accounts
An interesting discussion of Digital Radio Mondiale. Some comments about how the west has retreated from Shortwave broadcasting are particularly pertinent at the moment.
The good news, to me, is that there are modules coming that will make it easy to make consumer receivers with DRM reception.
Thanks to the good folks at World Radio TV Handbook.
The Melbourne chapter of the Radio Amateurs Old Timers club had an informative and entertaining presentation by Nigel Holmes, VK3DZ about the role of the Shepparton International High Frequency Transmitting Station in researching the ionosphere and even reflecting HF signals from the Moon’s surface.
There's a good train service from central Victoria down to Melbourne and then on to the Caulfield RSL where we meet so, naturally, we ended up on the train together. Here is VK3MO, VK3ACR, VK3XW, VK3WQ and VK3RV. Also in attendance was VK3CCR.
The meeting was well attended and the food was very good.
The Radio Old Timers Club is a national organisation but to my knowledge only Melbourne and Perth have lunch events.
If you are a 23andMe customer, like me, you should consider deleting your data. Are you a Windows 10 user? Microsoft is suggesting that you trade in your old computer soon to upgrade to 11. Do you read the lengthy terms of use many sites require - there may soon be an alternative that puts the user in the drivers' seat. Apple's Intelligence rollout hasn't gone well and now they're being sued for false advertising. All in Nightlife tech with Peter Marks. https://www.abc.net.au/listen/programs/nightlife/nightlife-tech-talk-with-peter-marks/105095170
Graeme, VK3CDO, came and gave a great presentation about portable operations gear at the Macedon Ranges Amateur Radio Club recently. He brought along a terrific folding chair and table which I immediately ordered. He suggested an outing and I was up for it. We set up on a beautiful day here in Victoria on Mount Macedon.
The weather was perfect. We both brought our chairs and tables. I brought a tent in case the weather turned (not likely). Graeme used a very nice MA-12 vertical antenna which was easy to set up and worked well. I strung up an end fed but had problems tuning it to either 40 or 20m. (I think the Unun I grabbed was not working).
Graeme operated a low cost, uSDX QRP radio with just the internal battery and easily made a contact.
We both brought small metho stoves which worked very well for cups of coffee & tea. Later we each cooked up a lunch. Graeme went for gourmet sausages while I tried a freeze dried meal which was very nice.
Graeme put me on to the chair and table. Both excellent: "Naturehike Camping Chair, Portable Backpacking Breathable Chair with Storage Bag, Compact Collapsible Lightweight Camp Chair (Green-M)" & "Naturehike Camping Detachable Table with Aluminum Alloy Material, Portable, Lightweight, Outdoor Furniture for Camping, Picnic, Hiking, and Other Outdoor Activities".
The tent is a "Night Cat Backpacking Tent fo 1 Person 2 Persons Easy Setup by Clip Waterproof Lightweight protable Camping Hiking Tent for Adults Kids Scouts Tent". I like it because it's under 2kg and has a convenient side entrance.
I kept John “lofty” Wiseman’s excellent SAS survival handbook at hand but luckily there were no emergencies requiring reference to it.
I look forward to even more ambitious outings in the future.