Skip to content

Instantly share code, notes, and snippets.

@ddxfish
ddxfish / wemos-r32-hw-130-motor-shield
Last active December 9, 2023 22:33
This is how you use the Wemos r32 (esp32) with the hw-130 adafruit motor shield v1 without a library. This example uses mecanum wheels so there is a sideways direction. This latches bits to the 74hc595 which pushes them to the l293 motor drivers.
#include <Arduino.h>
// Pin definitions
const int shiftRegisterLatch = 19;
const int shiftRegisterClock = 17;
const int shiftRegisterEnable = 14;
const int shiftRegisterData = 12;
// Bit positions in the 74HC595 shift register output
#define MOTOR1_A 2
@ddxfish
ddxfish / mycroft-watchdog-111.sh
Created October 19, 2021 16:50
Mycroft Service Watchdog
#!/bin/bash
# If you run mycroft in docker you may get Errno 111: Connection Refused
# On my container, a simple ./mycroft-stop and ./mycroft-start all fixes Error 111
# This script checks your audio.log for Error 111 and will restart the mycroft service if it occurs
# put the script in your container, then edit /opt/mycroft/startup.sh
# Add your background watchdog script after mycroft starts in startup.sh, like: /opt/mycroft/./watchdog.sh &
while true
do
thetime=`date +%s`
echo watchdogtest $thetime | tee -a /var/log/mycroft/audio.log