This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kev's Music Player | |
# A simple music player for MicroPython | |
# @Author: Kevin McAleer | |
# @Date: 2025-01-11 | |
import time | |
import machine | |
# Default configurations | |
DEFAULT_BPM = 120 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
import dht | |
from machine import Pin, WDT | |
import network | |
from simple import MQTTClient | |
from wifi_config import WIFI_SSID, WIFI_PASSWORD | |
# Configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import stepper motor driver - BYJ28 | |
# import range finder code | |
from range_finder import RangeFinder | |
from stepper_28byj48 import BYJ28 | |
from time import sleep | |
# Create a RangeFinder object | |
range_finder = RangeFinder(trigger_pin=1, echo_pin=0) | |
stepper = BYJ28([10,11,12,13]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin, PWM | |
class Motor: | |
def __init__(self, motor_pin_a, motor_pin_b, pwm_freq=1000): | |
# Initialize motor pins with PWM | |
self.pwm_a = PWM(Pin(motor_pin_a)) | |
self.pwm_b = PWM(Pin(motor_pin_b)) | |
self.pwm_a.freq(pwm_freq) | |
self.pwm_b.freq(pwm_freq) | |
self._speed = 0 # Speed range: 0 (stop) to 1 (full speed) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BurgerBot version 3 library | |
# Kevin McAleer | |
# 14 December 2024 | |
from motor import Motor | |
from range_finder import RangeFinder | |
from machine import Pin | |
class BurgerBot(): | |
left_motor = Motor(1,2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Syncthing - Open Source Continuous File Synchronization | |
Documentation=man:syncthing(1) | |
After=network.target | |
[Service] | |
User=pi | |
ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 | |
Restart=on-failure | |
RestartSec=5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker run -itd --name Portainer -p 8000:8000 -p 9443:9443 -v /var/run/docker.sock:/var/run/docker.sock cr.portainer.io/portainer/portainer-ce:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from gpiozero import LED | |
# Setup | |
led = LED(17) | |
iterations = 100000 # Number of times the LED will be toggled on and off | |
# Benchmark | |
start_time = time.time() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lesson 01 Movement | |
// www.smarsfan.com/play/lessons/lesson_01_movement | |
// set Motor A to Arduino Pins | |
int motor_A = 12; | |
int motor_B = 13; | |
// set the Motor Speed using the Arduino Pins | |
int motor_A_speed = 10; | |
int motor_B_speed = 11; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2023 Pete Warden | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
# Example of accessing the Tiny Code Reader from Useful Sensors on a Trinkey | |
# using CircuitPython. See https://usfl.ink/tcr_dev for the full developer guide. | |
# Modified by Kevin McAleer to run on standard MicroPython (original code was CircuitPython) | |
from machine import I2C, Pin | |
import struct |
NewerOlder