This file contains 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
/** | |
* Battery Babysitter Demo | |
* June 22, 2016 | |
* | |
* RGB LED changes colors based on LiPo state of charge | |
* | |
* Hardware: | |
* Babysitter | LED (Common Anode) | Arduino | |
* -------------|---------------------|--------- | |
* GND | | GND |
This file contains 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
#include <Wire.h> | |
#include <Adafruit_MSA301.h> | |
#include <Adafruit_Sensor.h> | |
Adafruit_MSA301 msa; | |
void setup() { | |
// Open serial port | |
Serial.begin(250000); |
This file contains 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
# This works for gym 0.26.2. It might not work on previous versions. | |
import gym | |
import cv2 | |
fps = 30 | |
# Create environment | |
env = gym.make('CartPole-v1', render_mode='rgb_array') |
This file contains 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
/** | |
* One Channel Receiver | |
* Author: Shawn Hymel (SparkFun Electronics) | |
* Date: Aug 17, 2017 | |
* | |
* Connect a TB6612FNG and RC (PWM) receiver to the Arduino. | |
* Only works 1 channel for forward and back drive. | |
* | |
* This code is beerware; if you see me (or any other SparkFun | |
* employee) at the local, and you've found our code helpful, |
This file contains 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
""" | |
PyGame Display Test | |
Run to see if you can draw things in Pygame. Press 'esc` to exit. Run with | |
root privileges to draw on external monitor (e.g. from SSH). | |
""" | |
import pygame | |
# Initialize pygame |
This file contains 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
#include <stdarg.h> | |
// Makeshift printf for the Serial terminal | |
void aprintf(const char *format, ...) { | |
static char print_buf[1024] = { 0 }; | |
va_list args; | |
va_start(args, format); | |
int r = vsnprintf(print_buf, sizeof(print_buf), format, args); | |
va_end(args); |
This file contains 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
/** | |
* Save Reminder | |
* Date: February 1, 2018 | |
* Author: Shawn Hymel (SparkFun Electronics) | |
* | |
* Connect to an open USB port on your computer. Every 5 minutes, | |
* the LED will begin flashing. Press the button to send a ctl+s | |
* or cmd+s key press to your computer to save your work. | |
* | |
* Pick your operating system by updating the OS variable. |
This file contains 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
#include <SoftwareSerial.h> | |
SoftwareSerial soft(10, 11); // Rx, Tx | |
void setup() { | |
Serial.begin(9600); | |
soft.begin(9600); | |
} | |
void loop() { |
This file contains 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 board | |
import busio | |
import time | |
from random import random | |
from adafruit_ht16k33 import matrix | |
# Initialize LED matrix | |
i2c = busio.I2C(board.SCL, board.SDA) | |
eye =matrix.Matrix8x8(i2c) |
This file contains 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
""" | |
OpenMV Live Image Inference | |
Continuously captures images and performs image using provided TFLite model | |
file. Outputs probabilities in console. Displays preview on LCD backpack along | |
with predicted label. | |
Author: EdgeImpulse, Inc. | |
Modified: Shawn Hymel | |
Date: September 26, 2021 |