Skip to content

Instantly share code, notes, and snippets.

/*
* AndySightM5Stack - Color Selector with Brightness Slider
* M5Stack Core2 with WS2812B RGB LED on GPIO 33
*
* Touch a colour swatch to change the LED colour.
* Drag the slider at the bottom to set brightness.
* Screen sleeps after 30 s of inactivity; any tap wakes it.
* Requires: M5Unified, FastLED libraries
*/
@lateAtNight
lateAtNight / MoteusTest.py
Created January 24, 2021 14:50
Basic use of the Moteus BLDC motor controller
import asyncio
import math
import time
import moteus
import matplotlib.pyplot as plt
async def main():
t = moteus.Fdcanusb(path="/dev/tty.usbmodemFBE14B831")
c = moteus.Controller(transport=t)
@lateAtNight
lateAtNight / GyemsMotorDemo.ino
Created January 14, 2021 21:22
Simple demo using the Sparkfun CAN bus shield to move the position of a Gyems motor.
#include <mcp_can.h>
#include <SPI.h>
MCP_CAN CAN0(10); // Set CS to pin 10
#define StepValue 130
/* Define Joystick connection pins */
#define UP A1
#define DOWN A3