Skip to content

Instantly share code, notes, and snippets.

mpflaga / Arduino-PhotoCellArrayAveraged.ino
Last active Jan 31, 2022
Arduino library of an array of averaged Analog Inputs connected PhotoCells (aka LDR)
View Arduino-PhotoCellArrayAveraged.ino
#include "PhotCellArrayAveraged.h"
PhotoCell ldr[] = {{Pins{A0, A1}, 10}, {Pins{A2, A3}, 10}, {Pins{A4, A5}, 10}, {Pins{A6, A7}, 10}};
unsigned period = 1000;
unsigned long nextPrintTime;
void setup() {
// initialize serial communications at 9600 bps
nextPrintTime = (unsigned long) (millis() + period);
mpflaga / Arduino-PhotoCellArray.ino
Last active Jan 30, 2022
Arduino library of an array of Analog Inputs connected PhotoCells (aka LDR)
View Arduino-PhotoCellArray.ino
#include "Arduino.h"
struct Pins {
uint8_t sig;
uint8_t gnd;
class PhotoCell
mpflaga / Arduino NeoPixel Increamenter Tester
Last active Feb 25, 2021
Simple sketch to increment and decrement a single NeoPixel on a string as to determine positions of interest for defining segments.
View Arduino NeoPixel Increamenter Tester
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#define PIN 6
#define NUMPIXELS 500
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int pos = 0;
mpflaga / Arduino NeoPixel Chaser
Created Feb 3, 2021
Simple Arudino to test a string of NeoPixels. One LED scrolls out the length, as to reduce power constraints
View Arduino NeoPixel Chaser
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#define PIN 6
#define NUMPIXELS 200
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#! /usr/bin/python
from __future__ import absolute_import
import sys, threading, argparse, pprint, logging, logging.handlers, os, __main__, platform
from socket import *
# Setup format for pprint.
pp = pprint.PrettyPrinter(indent=4)
BUFSIZE = 1024
mpflaga / IrSonicWand.ino
Last active Jul 2, 2018
IrSonicWand - Device to learn and simulate up to 4 MagiQuest wands, along with sound effects
View IrSonicWand.ino
# schematic -
#define LENGTH_OF_ARRAY(x) ((sizeof(x)/sizeof(x[0])))
// define pin locations
#define IR_RECV_PIN 2
#define IR_LED_TX_PIN 3
#define BUTTON_BLK_PIN 5
#define BUTTON_BLU_PIN 6
mpflaga / IrMagicWandDuelNeoPixel.ino
Last active Jul 2, 2018
IrMagicWandDuelNeoPixel- code for home made Magic Wand Kiosk receiver, using a Arduino with NeoPixels. It is an upgrade to TinyIRduel.ino
View IrMagicWandDuelNeoPixel.ino
* IrMagicWandDuelNeoPixel: IRrecvDump - dump details of IR codes with IRrecv
* IR detector/demodulator must be connected to the input RECV_PIN.
* IR Transmitter to JAM must be connected
* schematic
* Version 0.1 July, 2016
* Author: 2016 Michael P. Flaga
* This is an alternative to the TinyIRduel.ino
mpflaga / Synner_ET_SdCard
Last active Apr 15, 2016
Read a SdCard File and send contents over EasyTransfer library, support hot-swap of SdCard
View Synner_ET_SdCard
#include <SPI.h>
#include <SD.h>
#include <EasyTransfer.h>
#define LENGTH_OF_ARRAY(x)((sizeof(x) / sizeof(x[0])))
//create object
EasyTransfer ET;
const long intervalFileRead = 5 * 1000; // seconds
View Synner_ET
#include <EasyTransfer.h>
#define LENGTH_OF_ARRAY(x)((sizeof(x) / sizeof(x[0])))
//create object
EasyTransfer ET;
//put your variable definitions here for the data you want to send
int arraydata[5];
mpflaga / sparkyvixen.ino
Last active Jan 23, 2022
Sketch to daisy chain Arduino Mega's from a PC running Vixen, as to get infinite Cue's.
View sparkyvixen.ino
This sketch is used with Vixen Sequence to allow Arduino's to be daisy chained.
see for details.
#define FIRST_IN_CHAIN 1 // set this to 1 for the first in Chain
#define SIZE_OF_ARRAY(X) (sizeof(X)/sizeof(X[0])) //total length divided by length of one element
// As specified in Vixen's General Serial Port Setup "Send a Text Footer"