
My scope didn’t save the test capture .. Next time.
But I could see the clear ones and zeros.
Dirk cleaned up a OCR version of the program, which I cleaned up some more, and found some errors.
So that should be okay now.
My scope didn’t save the test capture .. Next time.
But I could see the clear ones and zeros.
Dirk cleaned up a OCR version of the program, which I cleaned up some more, and found some errors.
So that should be okay now.
Install and start Thonny.
Tools > Options > Interpreter
Python test code (1 second blink)
Note: for the normal pico without Wi-Fi, it is GP25 instead of LED.
from machine import Pin import utime led_onboard = Pin('LED', Pin.OUT) while True: led_onboard.on() utime.sleep(1) led_onboard.off() utime.sleep(1)
Run at boottime?
File > save as:
Select device and name the python script main.py
Arduino Uno with Husky Lens using I2C
The HuskyLens is an easy-to-use AI machine vision sensor. It is equipped with multiple functions such as:
Via the UART / I2C port you can among others: boards connect:
Steps to take: Press Face detection, when a cross in a square is displayed, press the button on your HuskyLens
Set your husky protocol to I2C in the settings.
Minimal Code needed
/*************************************************** HUSKYLENS An Easy-to-use AI Machine Vision Sensor <https://www.dfrobot.com/product-1922.html> ****************************************************/ #include "HUSKYLENS.h" HUSKYLENS huskylens; //HUSKYLENS green line >> SDA; blue line >> SCL int ID0 = 0; //not learned results. Grey result on HUSKYLENS screen int ID1 = 1; //first learned results. colored result on HUSKYLENS screen int ID2 = 2; //second learned results. colored result on HUSKYLENS screen // and so on..... int arjprevious = 0; void printResult(HUSKYLENSResult result); void setup() { Serial.begin(115200); Wire.begin(); while (!huskylens.begin(Wire)) { Serial.println(F("Begin failed!")); Serial.println(F("1.Please recheck the \"Protocol Type\" in HUSKYLENS (General Settings>>Protocol Type>>I2C)")); Serial.println(F("2.Please recheck the connection.")); delay(100); } huskylens.writeAlgorithm(ALGORITHM_FACE_RECOGNITION); } void loop() { if (huskylens.requestLearned()) //request blocks and arrows tangged ID != 0 from HUSKYLENS if (huskylens.requestBlocksLearned()) //request blocks tangged ID != ID0 from HUSKYLENS { for (int i = 0; i < huskylens.countArrows(ID0); i++) { HUSKYLENSResult result = huskylens.getArrow(ID0, i); } int arj = huskylens.count(ID1); if ( arj != arjprevious ) { if ( arj == 1 ) { Serial.println("Learned face detected"); } else { Serial.println("Learned face not detected"); } arjprevious = arj; } } else { Serial.println("Fail to request objects from Huskylens!"); } }
Learned face detected ID1 Learned face not detected Learned face detected ID1 Learned face not detected Learned face detected ID1 Learned face not detected
This is NOT a post about the pi-hole project. Of which I apparantly never posted my setup.
I needed an extra PI for a project, and I always try to keep one spare.
But they are always gone, in use, missing .. whatever.
So I can´t work on this project right now, so lets rant about disappearing stuff
Like they are being sucked up in another dimension .. gone. WHERE ARE THEY?!?
How to keep track of them?
Any suggestions?
I used to have a sheet, but I often forget to keep track.
Do I use a MAC address scan on my switches?
First 3 parts of the Mac address are vendor specific.
So far i’ve found : Octopi, Beerbrew computer, Retro Arcade, Picore, Nodered, Domoticz 433toMqtt, Ledserver, Lasercutter-etch-a-sketch, mobile LMS music server, Pressure Lab AP, Escape Game AP (3 of them), one unused Raspberry zero (without Wifi), One at my old work, one broke, Kodi+Netflix,Ansible project, found another one .. Jumanji/Dashticz/NoderedDashboard demo (with screen)
WHERE THE F are the rest of them?
(Sdcards with temporary projects on them 29, I need to combine project on those cards. I’ve got a 64Gb card holding a Rpi OS and only a 1K python script!)
And Arduino’s are even worse … they are all over the place.
Those are probably 100+
(ESP32, 8266, Nano’s, Mega, M5Stack and alikes)
I know i have many temporary projects, but I keep most things organized in my projects containers.
One of the rows with Ikea containers, a few for bigger projects and now i’m using the plastic boxes you get when you order chinese or thai.
Here I’m going to post my tests with OpenPLC.
UPDATE 20231012 202301015
It’s a long time i’ve made a PLC ladder, but lets see how and what this integration brings me.
UPDATE 20231015 – Raspberry 3 with OpenPLC
GND to leds and buttons
GPIO2 (pin 3) to a button
GPIO3 (pin 5) to another button
GPIO14 (pin 8) to the led
Now OpenPLC works correct (RPI3)
https://github.com/thiagoralves/OpenPLC_v3.git cd OpenPLC_v3 ./install.sh rpi ## Warning .. takes a really long time Wiringpi is deprecated But can be installed using the last git repo git clone https://github.com/WiringPi/WiringPi.git cd WiringPi ./build
Yesterday I got my MAX9814 in, last night I got it working.
Used the leds from a lightpainter project to test controlling the leds.
Why is it, that it doesn’t matter how much components and ledstrips you buy, you alway need more.
Arduino Nano, using FastLeds library and FFT.
Ledstrip is WS2812, and the MAX8914 microphone
While watching a online python course, I was writing the code for a music guessing game (Highland Bagpipe Tunes)
The core is working, now it’s a matter of filling this “pruts” with tunes.
Switching between python, php, bash and C is a nightmare 🙂
Then the postman came .. with goodies.
I needed the MAX9814 analog microphone with amplifier, all of my other sensors were not up to the task.
So I switched to this WIP with the MAX9814.
I want to make a little gadget using an Arduino and 9 leds, which uses FFT to blink which note I am playing on my Highland Pipes.
So detecting is working, now I have to attach a bunch of leds.
Next thing I did today:
Getting my waveshare RP-2040 Zero working with micropython.
Great the little NeoPixel Led on the board.
Steps to get this working:
Want to run program @boot ?
save -> to device, and call main.py
I’m still having problems getting a working floppy drive in my machine.
(Broken FDD card, drive errors etc)
The raster bar (also referred to as rasterbar or copperbar) is an effect used in demos and older video games that displays animated bars of colour, usually horizontal, which additionally might extend into the border, a.k.a. the otherwise unalterable area (assuming no overscan) of the display
I first tried to get it working in DosBOX, but thats a mess.
Good for simple emulation but not hardcore register manipulation.
Below dosbox
Three examples below are in PCem
use16 org 0x100 CRTC_INDEX = 0x03D4 CRTC_DATA = 0x03D5 INPUT_STATUS = 0x03DA MAXIMUM_SCAN_LINE = 0x09 LINE_OFFSET = 0x13 jmp start updown DB 30 direction DB 0 filename DB "shoes.bmp",0 start: ; set mode 320x200 256 colors palette mov ah,0x0 mov al,13h int 10h ; clear screen routine, not really needed clearscreen: push ax mov ax, 0a000h mov es, ax pop ax xor di, di inc ax mov cx, 64000 ; 320x200 rep stosb ; call file loader call Loadfile push cs pop ds ; after displaying the image or displaying an error, wait for keypress to exit waitforkeyloop: call effect ; Calling the effect MOV AH,1 INT 16h JZ waitforkeyloop XOR AH,AH INT 16h Exit: MOV AX,3 ; default text mode 3 INT 10h MOV AX,4C00h ; exit to dos (terminate process) INT 21h Loadfile: MOV DX,filename MOV AX,3D00h ; open filehandle INT 21h JC Err1 MOV BX,AX ; filehandle MOV CX,0FFFFh ; size mov dx,0a000h ; destination 0000:a000h - Screen memory mov ds,dx MOV DX,0 MOV AH,3Fh ; read from file INT 21h JC Err1 MOV AH,3Eh ; close filehandle INT 21h RET ; print error Err1: push cs ; make ds same as cs pop ds MOV DX,TxtErr1 ; error MOV AH,09h INT 21h RET effect: cli ; stop interrupts call waitvretrace ; wait for vertical retrace mov al, 0 ; set color index 0 to black (needs to be converted to a function mov dx, 3c8h out dx, al inc dx ; now 3c9h mov al, 0h out dx, al ; set R = 0 mov al, 0h out dx, al ; set G = 0 mov al, 0h out dx, al ; set B = 0 ; gets start scanline and direction mov al,[updown] mov ah,[direction] cmp ah,0 jz addcounter dec al cmp al,30 jnz gohere mov ah,0 mov [direction],ah jmp gohere addcounter: inc al cmp al,100 jnz gohere mov ah,1 mov [direction],ah gohere: mov [updown],al ; al = scanline, call wait for scanline call waithretrace mov al, 0 ; set color index 0 to blueish mov dx, 3c8h out dx, al inc dx mov al, 11h out dx, al mov al, 22h out dx, al mov al, 33h out dx, al ; wait 10 scanlines (height of bar) mov al,10 call waithretrace ; draw black again mov al, 0 ; set color index 0's rgb value mov dx, 3c8h out dx, al inc dx ; now 3c9h mov al, 0 out dx, al ; set R = 11h mov al, 0h out dx, al ; set G = 22h mov al, 0h out dx, al ; set B = 33h sti ; start interrupts again ret ; this waits for vertical retrace waitvretrace: mov dx,INPUT_STATUS waitv1: in al,dx test al,8 jnz waitv1 waitv2: in al,dx test al,8 jz waitv2 ret ; routine that waits for horizontal retrace waithretrace: mov cl,al mov dx,INPUT_STATUS waith1: in al,dx test al,1 jnz waith1 waith2: in al,dx test al,1 jz waith2 dec cl cmp cl,0 jnz waith1 ret TxtErr1 DB "shoes.bmp not found!",7,10,13,"$"
Quiet days, I working on some art.
But here are the last ‘prutsen’
My current Wifi setup
I’ve got a Wifi outside of my network for guest and emergency. ( 2 SSIDs)
Then a main Wifi router in my livingroom, one in my workshop/studio and one in the Attic (Electronics Lab)
So three main Wifi AccessPoints. These all have the same SSID’s but on different frequencies. That way i’ve got roaming in and outside my house.
Also some virtual accesspoints are configured.
I’ve got a main, folkband, IOT, guest-inside all on 2.4Ghz and 5Ghz.
I watched a lot of YT presentations about Mikrotik Wifi.
So I ended up with DFS safe channels 20Mhz for 2.4 and 20/40Mhz Ce for 5Ghz. (subchannels for each after some frequency scanning)
(2.4 does a failback to 20Mhz whenever there is even one client detected which connects only on this band. Such as some old IOT stuff)
2.4 in only 1,6 and 11 no overlap, each on another device.
300Mbps is sufficient for my wifi 🙂
I’ve got accesslists in place and i’m going to read into kicking a client when the signal strenght is below -50dB
80386 (DX) Computer
Besides my 8088 and 8086 machines I needed a machine which could run our old demo’s. So I bought a new toy.
It has 8Mb Ram and runs at 40Mhz.
I’ve noticed that many of my VGA register manipulation code, can’t be run on a modern VGA monitor, I need to use a CRT for that .. Another thing to buy
Lilygo T-Display S3 Streaming
Not my code: https://github.com/Steve5451/esp32-stream-desktop
A very cool project!
Needed to fix arduino code, due to the TFT_eSPI library issues.
And I’ve got a S3 with another resolution, but that was an easy fix.
Then needed to reinstall nodejs with another version.
Had to modify the code because the tcp server would not start.
Weird errors logging, but in the end fixed … very cool
I probably end up designing a 3D printed case that looks like a monitor or tv.
Perviously i’ve posted about PCem
But I wanted to have a emulator which could load extension biosses also.
This for my own tinkering.
I was told to look at MartyPC and PCE/ibmpc
I don´t like it being written in Rust, but it does the job.
ROM config part i’ve got in martypc.toml
rom_override = [ { path = "./roms/BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN", address = 0xF0000, offset=0, org="Normal" }, { path = "./roms/BIOS_5160_09MAY86_U18_59X7268_62X0890_27256_F800.BIN", address = 0xF8000, offset=0, org="Normal" }, { path = "./roms/myromextension.bin", address = 0xF6000, offset=0, org="Normal" } ]