Skip to content

Instantly share code, notes, and snippets.

View nseidle's full-sized avatar

Nathan Seidle nseidle

View GitHub Profile
@nseidle
nseidle / pdm.ino
Last active June 2, 2022 09:23
PDM Audio harvester to serial
/* Author: @justiceamoh and Nathan Seidle
Created: November 19th, 2019
License: MIT. See SparkFun Arduino Apollo3 Project for more information
This example demonstrates how to read audio data and output
it to a WAV file. This sektch outputs raw serial, an accompanying
python script visualizes and coverts the raw data to a WAV file.
Note: Audio samples are generated fast enough that we need to output
serial at 500kbps.
/* Author: Nathan Seidle
Created: July 24, 2019
License: MIT. See SparkFun Arduino Apollo3 Project for more information
This example demonstrates how to use the PDM microphone on Artemis boards.
*/
#define ARM_MATH_CM4
#include <arm_math.h>
#include <Wire.h> // Must include Wire library for I2C
#include <SparkFun_MMA8452Q.h>
MMA8452Q accel(0x1D); // Initialize the MMA8452Q with an I2C address of 0x1C (SA0=0)
void setup()
{
Serial.begin(115200);
Serial.println("MMA8452Q Test Code!");
@nseidle
nseidle / Laser.cpp
Last active September 29, 2016 17:20
//Initialize the Serial port
bool Laser::begin(Stream &serialPort)
{
_laserSerial = &serialPort; //Grab which port the user wants us to use
//_laserSerial->begin(); //Stream has no .begin() so the user has to do a whateverSerial.begin(xxxx); from setup()
}
//Send a command to the laser
void Laser::sendCommand(String command)
{
This is just a snippet. The full files are here: https://github.com/sparkfun/Genericized_Library_Examples
#include "Laser.h" //The example lib
Laser myLaser; //Instantiate an instance of the class
void setup()
{
Serial.begin(9600); //We have to start the serial port before we call begin()
myLaser.begin(Serial); //Pass the port object to the library
}
@nseidle
nseidle / Memory.cpp
Last active September 29, 2016 17:21
//Initialize the I2C port
bool Memory::begin(TwoWire &wirePort)
{
_i2cPort = &wirePort; //Grab which port the user wants us to use
_i2cPort->begin();
}
//Store a piece of data (thing) into a given address (place)
void Memory::writeValue(uint16_t place, uint8_t thing)
{
This is just a snippet. See the full files here: https://github.com/sparkfun/Genericized_Library_Examples
#include "Memory.h" //The example lib
Memory myStorage; //Instantiate an instance of the class
void setup()
{
Serial.begin(9600);
myStorage.begin(Wire); //Pass the I2C Port to the library
}
@nseidle
nseidle / makehub
Created July 27, 2014 11:58 — forked from VimKanzo/makehub
Intelligent Traffic Control System (ITCS)
# Title
Intelligent Traffic Control System (ITCS)
# Picture
media: http://www.deviantsart.com/8eadk4.jpg
# Objective
PROJECT AIM:
The aim of this project is to monitor and report on the traffic light in the country which is one of the cause of traffic in the country since most of them are not functioning and they are also been monitored manually. Our project initiative aims to solve the problem of manual monitoring. Our project will monitor traffic lights by the use of sensors and report to MTTU whenever a traffic light breaks down by triggering the sensors to pinpoint the location of where the traffic light is and send out an SMS alert to MTTU for them to know there is a traffic light breaks down. We believe this is going to help the MTTU monitor traffic light effectively and attend to them within the shortest possible time. We also want to use solar panels as secondary power and backup for the traffic lights ensuring that they are operational always.
@nseidle
nseidle / SerialControl
Created March 23, 2013 16:29
Basic serial control of OpenSegment or Serial7Segment using Arduino v1.x
/*
9-23-2012
Spark Fun Electronics
Nathan Seidle
This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Serial7Segment is an open source seven segment display.
This is example code that shows how to display basic numbers on the display.
Note: This code expects the display to be listening at 9600bps. If your display is not at 9600bps, you can
@nseidle
nseidle / H2ONo
Created February 1, 2013 17:45
A simple program that detects water and sets off an alarm (buzzer) and blinks an LED.
/*
1-14-2013
Spark Fun Electronics
Nathan Seidle
This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
When the ATtiny senses water between two pins, go crazy. Make noise, blink LED.
Created to replace the water sensor in my Nauticam 17401 underwater enclosure. The original board