Skip to content

Instantly share code, notes, and snippets.

View ShawnHymel's full-sized avatar

Shawn Hymel ShawnHymel

View GitHub Profile
@ShawnHymel
ShawnHymel / fred_bot.ino
Last active April 21, 2024 12:38
Use two magnetic encoders to make a robot drive in a straight line for 1 meter
/**
* Adventures in Science: Fred Bot
* SparkFun Electronics
* Author: M. Hord (October 8, 2013)
* Modified by: B. Huang (October 31, 2014)
* Modified by: Shawn Hymel (July 21, 2017)
*
* Use two magnetic encoders on Fred's motor shafts (48:1
* gearbox, 60mm wheels) to make him move in a straight line for
* 1m.
@ShawnHymel
ShawnHymel / classify-directory.py
Last active February 28, 2024 21:58
Edge Impulse - Classify all images in a directory
#!/usr/bin/env python
import device_patches # Device specific patches for Jetson Nano (needs to be before importing cv2)
import cv2
import os
import sys, getopt
import numpy as np
from edge_impulse_linux.image import ImageImpulseRunner
@ShawnHymel
ShawnHymel / GridEYE_LEDs.ino
Created May 2, 2018 20:24
Demo of the Grid-EYE IR sensor using an LED array
/**
* GridEye LED Array Demo
* Author: Shawn Hymel (SparkFun Electronics)
* Date: May 1, 2018
*
* Displays a heat map of what the GridEye sees (8x8 pixels).
*
* Required Components
* - Arduino: https://www.sparkfun.com/products/13975
* - Qwiic Shield: https://www.sparkfun.com/products/14352
@ShawnHymel
ShawnHymel / magic_wand_standardized_inference.ino
Created October 10, 2022 19:38
Edge Impulse magic wand inference example
/**
* Magic Wand Inference Demo
*
* Attach a button to pin 2. Press button to start collection. Raw data will be
* collected and fed to the impulse for inference. Inference results are printed
* to the serial terminal.
*
* Author: Shawn Hymel (EdgeImpulse, Inc.)
* Date: October 10, 2022
* License: Apache-2.0 (apache.org/licenses/LICENSE-2.0)
@ShawnHymel
ShawnHymel / tflite_sinewave_training.ipynb
Created March 18, 2020 17:42
TensorFlow Lite Sinewave Regression Training and Conversion
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ShawnHymel
ShawnHymel / quantized-inference-example.py
Last active December 9, 2023 07:47
TensorFlow Lite (TFLite) Python Inference Example with Quantization
# TFLite quantized inference example
#
# Based on:
# https://www.tensorflow.org/lite/performance/post_training_integer_quant
# https://www.tensorflow.org/lite/api_docs/java/org/tensorflow/lite/Tensor.QuantizationParams
import numpy as np
import tensorflow as tf
# Location of tflite model file (float32 or int8 quantized)
@ShawnHymel
ShawnHymel / ei_json_to_csv.ipynb
Last active September 22, 2023 10:15
Edge Impulse JSON to CSV
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ShawnHymel
ShawnHymel / two_channel_receiver.ino
Created August 24, 2017 15:17
Mixing 2 channels from an RC hobby controller for arcade drive
/**
* Two Channel Receiver
* Author: Shawn Hymel (SparkFun Electronics)
* Date: Aug 24, 2017
*
* Connect a TB6612FNG and RC (PWM) receiver to the Arduino.
* Mixes two channels for arcade drive.
*
* This code is beerware; if you see me (or any other SparkFun
* employee) at the local, and you've found our code helpful,
@ShawnHymel
ShawnHymel / esp32_websocket_host.ino
Created March 3, 2019 22:23
ESP32 WebSocket Host
#include <WiFi.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
#include <WebSocketsServer.h>
// Constants
const char *ssid = "ESP32-AP";
const char *password = "LetMeInPlz";
const char *msg_toggle_led = "toggleLED";
const char *msg_get_led = "getLEDState";
@ShawnHymel
ShawnHymel / time_series_dataset_curation.ipynb
Last active May 1, 2023 14:20
CSV Time Series Dataset Curation and Standardization
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.