Skip to content

Instantly share code, notes, and snippets.

View jasonhejna's full-sized avatar

Jason Hejna jasonhejna

View GitHub Profile
// LAMP 198
#include <Adafruit_DotStar.h>
#include <SPI.h>
#define NUMPIXELS 60 // Number of LEDs in strip
// Here's how to control the LEDs from any two pins:
#define DATAPIN 2
#define CLOCKPIN 6
// Tyler's Lamp
#include <Adafruit_DotStar.h>
#include <SPI.h>
#define NUMPIXELS 62 // Number of LEDs in strip
// Here's how to control the LEDs from any two pins:
#define DATAPIN 6
#define CLOCKPIN 2
/*
Digalog
{"relay1":0,"relay2":1,"UUID":"tornado-airplane","pot1":[80,985],"pot2":[50,353],"pot3":[50]}
*/
#include <ArduinoJson.h>
#include <FlashStorage_SAMD.h>
// UUID placeholder
String UUID = "tornado-airplane";
#include <Arduino.h>
#include <U8g2lib.h>
#include <Wire.h>
// screen lib setup
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/U8X8_PIN_NONE, /* clock=*/SCL, /* data=*/SDA); // pin remapping with ESP8266 HW I2C
#define boost_en 13
#define L1F A4
#define L2F A5
#!/bin/bash
# File to store the CPU temperature logs
LOG_FILE="cpu_temp_log.csv"
# Function to get CPU temperature
get_cpu_temp() {
# Using sensors command to get CPU temp from the specified sensor
sensors | grep 'temp1:' | awk '{print $2}' | tr -d '+C'
}
@jasonhejna
jasonhejna / gist:974f3de54d742168fdcedf9ad0155503
Last active February 2, 2024 20:54
camera_capture_test.py
import cv2
import os
import time
def main():
# Camera settings
width, height, fps = 640, 360, 260
frame_count_to_capture = fps # Number of frames for 1 second
temp_image_folder = "temp_images"
os.makedirs(temp_image_folder, exist_ok=True)
@jasonhejna
jasonhejna / ximea_camera.py
Created February 13, 2024 15:47
ximea_camera.py
from ximea import xiapi
import time
#create instance for first connected camera
cam = xiapi.Camera()
#start communication
#to open specific device, use:
#cam.open_device_by_SN('41305651')
#(open by serial number)