It has an EPROM with Wozmon and Basic for now. I have to redo the address decoder, but I like the simple serial interface by Geoffrey. (I hate the PIC18F15Q41, made by Microchip, but still the best minimal option .. for now)
Probably the last time i’ve used a pic was in 1998
The HuskyLens is an easy-to-use AI machine vision sensor. It is equipped with multiple functions such as:
Face recognition
Object tracking
Object recognition
Line trace
Color recognition
Tag recognition (QR code).
Via the UART / I2C port you can among others: boards connect:
Arduino
micro:bit
Raspberry Pi
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
Some AI generated art I made – electronic components being sucked into a black hole.
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.
It’s a long time i’ve made a PLC ladder, but lets see how and what this integration brings me.
OpenPLC interface on a Raspberry, I could not start a program on RPI 5! But it compiled correctly. See below rpi3
OpenPLC editor with timer ladders for Arduino
Schematic with a led and two buttons (and one floating in the middel, which i forgot to remove)
Working example ( wemos and display are from another project those are not connected )
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
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 🙂
A screenshot of work in progress
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.
First test using Arduino Cloud (I still prefer PlatformIO) But this is better than the old IDE. (Note, you have to install an agent to connect your browser to a board)
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:
Install Thonny
Connect the rp2040 via USB with the boot button pressed
place RPI_pico.xxxx.uf2 on the mounted usb disk, it will reboot
Run Thonny connect and run a test program
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
When you look at the left side of the screen you see the color bar in the border (outside the normal pixel screen)
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
Not waiting for vsync, gives some idea how much timing is left when doing barsOther effect addedEffect as on the real hardware except emulated using 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,"$"
"If something is worth doing, it's worth overdoing."