Skip to content

Instantly share code, notes, and snippets.

View jasonhejna's full-sized avatar

Jason Hejna jasonhejna

View GitHub Profile
@jasonhejna
jasonhejna / ATtiny85_cellular_MG2639.ino
Last active February 13, 2016 06:53
ATtiny85 code for serial communication with the MG2639 cellular modem
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
// Timing Characteristics All constants in this section defined in milliseconds
#define POWER_PULSE_DURATION 2000 // 2-5s pulse required to turn on/off
#define MODULE_OFF_TIME 10000 // Time the module takes to turn off
#define COMMAND_RESPONSE_TIME 500 // Command response timeout on UART
#define MODULE_WARM_UP_TIME 3000 // Time between on and ready
"""Ingests a customer list from MS and helps detect / convert the fields for quicker ET ingestion"""
# TODO: add delete
import shutil
import os
import ntpath
FILE_PATH = raw_input('Enter the file path: ')
@jasonhejna
jasonhejna / double_tap_light.ino
Last active December 30, 2015 04:51
When you flick the lights on and off it will trigger. Arduino with a photo-resistor.
// DOUBLE TAP LIGHT 0.1
unsigned long off_timer = 18000;
int power = 3;
int sensor = 5;
int threshold = 190;
unsigned long loop_count = 0;
int sense_val = 0;
#include <stdio.h>
int main()
{
for ( int i=0; i < 3; i++ ){
printf("%s\n", "Ho");
}
printf("%s\n", "Happy Holidays");
return 0;
}
@jasonhejna
jasonhejna / christmas_card_2016_c.md
Last active November 28, 2016 19:25
holiday card 2016
    .--._.--.--.__.--.--.__.--.--.__.--.--.__.--.--._.--.
  _(_      _Y_      _Y_      _Y_      _Y_      _Y_      _)_
 [___]    [___]    [___]    [___]    [___]    [___]    [___]
 /:' \    /:' \    /:' \    /:' \    /:' \    /:' \    /:' \
|::   |  |::   |  |::   |  |::   |  |::   |  |::   |  |::   |
\::.  /  \::.  /  \::.  /  \::.  /  \::.  /  \::.  /  \::.  /
 \::./    \::./    \::./    \::./    \::./    \::./    \::./
 '=' '=' '=' '=' '=' '=' '='
@jasonhejna
jasonhejna / Readme.md
Created June 28, 2018 20:53
MongoDB update data for schema changes

/** *

  • Run this script with the command: node schema-migration.js ./example-schema-update-rules.json
  • Replace example-schema-update-rules.json with your own version of the file.
  • There are three JSON operations for modifying data...
  • @addFields will add new fields to the data with a value you can optionally specify
  • @updateFields will map a field over to to a new key. Persisting the data value.
  • @deleteFields will delete the fields you specify
@jasonhejna
jasonhejna / autohotspot
Created September 3, 2018 15:29
Raspberry Pi IOT WiFi
#!/bin/bash
#version 0.95-4-N/HS
#You may share this script on the condition a reference to RaspberryConnect.com
#must be included in copies or derivatives of this script.
#A script to switch between a wifi network and a non internet routed Hotspot
#Works at startup or with a seperate timer or manually without a reboot
#Other setup required find out more at
#http://www.raspberryconnect.com
@jasonhejna
jasonhejna / curtain.ino
Last active June 28, 2019 22:35
Robotic Curtain Control
// Stage Curtain Control System
//
// A Hall Effect Sensor is used to count the rotations of the drive motor. Two relays are used to power the motor on in either direction.
// Input is provided by an Up, and Down button operating on 12v DC.
// Input may be added later using WiFi, or Schedules.
//
// Author: Jason Hejna ([email protected])
// Author: Mukesh Ramani
//void count_motor_rotation(void);
// Simple strand test for Adafruit Dot Star RGB LED strip.
// This is a basic diagnostic tool, NOT a graphics demo...helps confirm
// correct wiring and tests each pixel's ability to display red, green
// and blue and to forward data down the line. By limiting the number
// and color of LEDs, it's reasonably safe to power a couple meters off
// the Arduino's 5V pin. DON'T try that with other code!
#include <Adafruit_DotStar.h>
// Because conditional #includes don't work w/Arduino sketches...
#include <SPI.h> // COMMENT OUT THIS LINE FOR GEMMA OR TRINKET
// Simple strand test for Adafruit Dot Star RGB LED strip.
// This is a basic diagnostic tool, NOT a graphics demo...helps confirm
// correct wiring and tests each pixel's ability to display red, green
// and blue and to forward data down the line. By limiting the number
// and color of LEDs, it's reasonably safe to power a couple meters off
// the Arduino's 5V pin. DON'T try that with other code!
#include <Adafruit_DotStar.h>
// Because conditional #includes don't work w/Arduino sketches...
#include <SPI.h>