#garfield Logs

May 01 2025

#garfield Calendar

12:26 AM aandrew: wow this is impressive
12:41 AM aandrew: had a guy contact me out of nowhere about a VOIP project
12:41 AM aandrew: his company basically interfaces old security systems that use POTS lines with ATAs, but some of them have trouble when they call in due to delays and so on
12:41 AM aandrew: it's all (largely) DTMF based
12:41 AM aandrew: anyway I asked the LLM to make me a python project that takes a wav file and does the tone detection, spitting out JSON with detection events
12:41 AM aandrew: it started out with FFT which I expected it to do, and it worked mostly
12:41 AM aandrew: but I asked it to switch to a Goertzel algorithm instead
12:41 AM aandrew: then some iterating over formatting, combining consecutive detection events (it wos emitting an event for every detection window) and so on
12:41 AM aandrew: the result is kind of nifty
12:41 AM aandrew: https://pastebin.com/4WU2tFA1
04:24 AM rifraf: the postman just came at 7.15pm
04:28 AM rifraf: so excited, most wanted toy all year
04:58 AM rifraf3: freakin amazing, could not have wished for more, i have a freakin levitator and it works perfect
04:59 AM rifraf3: already had a top spining on it for 30 minutes, so acheived everything i wanted, have put aside while its still going, handled a few crashes well
03:45 PM aandrew: you have a what now?
03:45 PM aandrew: also: https://ibb.co/chQhq1zb
03:46 PM aandrew: the detecting tones was the easy part. It was the making cue points in a wav file that was brain bending
04:46 PM rifraf: me? a levitating machine
04:46 PM rifraf: remeber a few weeks back i was trying to get someone invoved to make one
04:49 PM rifraf: will make cooler vid but just uploading a short now
04:55 PM rifraf: https://youtube.com/shorts/Dpn6rekIFbA
04:56 PM rifraf: the spinning top actually makes the whole thing spin slowly so must be reducing friction too
05:00 PM rifraf: but already minimal friction, top only weights about 8 to 10 grams in that setup
07:05 PM rue_mohr: yay! I remembered to get the bike chain for the sprayers
07:06 PM rue_mohr: socks
07:06 PM rue_mohr: I need to wash some sox
08:02 PM rue_mohr: void pulseState1(void) {
08:02 PM rue_mohr: funDigitalWrite(PA2, FUN_HIGH); // Turn on output 1
08:02 PM rue_mohr: trackTime += t1; // trackTick+=t1
08:02 PM rue_mohr: SysTick->CMP = trackTime; // next irq trackTick
08:02 PM rue_mohr: cycleTime -= t1; // subtract t1 from cycletime
08:02 PM rue_mohr: Handler = pulseState2; // set state 2
08:02 PM rue_mohr: }
08:02 PM rue_mohr:
08:02 PM rue_mohr: void pulseState2(void) {
08:02 PM rue_mohr: funDigitalWrite(PA2, FUN_LOW); // output 1 off
08:02 PM rue_mohr: funDigitalWrite(PA3, FUN_HIGH); // output 2 on
08:03 PM rue_mohr: trackTime += t2; // trackTick+=t2
08:03 PM rue_mohr: SysTick->CMP = trackTime; // next irq trackTick
08:03 PM rue_mohr: cycleTime -= t2; // subtract t2 from cycletime
08:03 PM rue_mohr: Handler = pulseState3; // set state 3
08:03 PM rue_mohr: }
08:03 PM rue_mohr:
08:03 PM rue_mohr: void pulseState3(void) {
08:03 PM rue_mohr: funDigitalWrite(PA3, FUN_LOW); // output 2 off,
08:03 PM rue_mohr: trackTime += cycleTime; // trackTick+=cycletime
08:03 PM rue_mohr: SysTick->CMP = trackTime; // next irq trackTick
08:03 PM rue_mohr: cycleTime = 20000; // set cycletime to 20000 (20 ms)
08:03 PM rue_mohr: Handler = pulseState1; // set state 1
08:03 PM rue_mohr: }
08:03 PM rue_mohr: void SysTick_Handler(void) { /// interrupt trampoline function, wrapps all the pushes and pops for us.
08:03 PM rue_mohr: Handler();
08:03 PM rue_mohr: }
08:03 PM rue_mohr: it wasn't the trampoline I'd hoped for, but someone got to do those push/pops
08:21 PM rue_mohr: WELL
08:21 PM rue_mohr: that should be the core code to run a hobby servo on CH32, thats pretty good.
10:28 PM rue_mohr: ok, well, if this works it should generate some pulses, so,
10:28 PM rue_mohr: to try it, I need a ch32
10:29 PM rue_mohr: ok, the bedroom contains the wrong ones
10:29 PM rue_mohr: might have to solder one up
10:30 PM rue_mohr: might as well find something I can fit a 3.3V regulator on too