Skip to content

Instantly share code, notes, and snippets.

View danasf's full-sized avatar

Dana Sniezko danasf

  • Berlin, California
View GitHub Profile
@danasf
danasf / useful.c
Last active August 29, 2015 14:04
Useful Beaglebone Memory Locations
#define GPIO0 0x44e07000 // GPIO0 Controller
#define GPIO1 0x4804c000 // GPIO1 Controller
#define GPIO2 0x481ac000 // GPIO2 Controller
#define GPIO3 0x481ae000 // GPIO3 Controller
#define GPIO_SET_OUT 0x194 // Set 1s to OUT
#define GPIO_SET_CLEAR 0x190 // Set 1s to CLEAR
#define GPIO_DATAOUT 0x13c // SET ALL bits to state specified
#define GPIO_DATAIN 0x138 // Read state of all pins?
@danasf
danasf / blink.c
Last active August 29, 2015 14:03
Blink
/* blink lights on ATTiny with AVR-C */
#define F_CPU 1000000UL
#include <avr/io.h>
#include <util/delay.h>
#define LED4 PB4
#define LED3 PB3
#define LED2 PB2
/**
* GIFfy
* Make an animated gif from your quicktime .mov screen capture
* Public Domain
*/
import processing.video.*;
import gifAnimation.*;
Movie mov;
# Work with the Samsys 2.8 RFID reader over serial, strip out dupe output
# Adapted from a threaded serial "chat" snippet
# http://stackoverflow.com/questions/10465952/python-chat-program-for-serial-port-connection-rs-232
#
# Default port and baudrate are /dev/serial/by-id/usb-Keyspan__a_division_of_InnoSys_Inc._Keyspan_USA-19H-if00-port0 and 57600
#
# Refer to CHUMP command reference for commands, include ! at end of your command
# http://www.sirit.com/Tech_Support_Downloads/CHUMP_Prot_Ref_Gd_v7.0[1].pdf
# in the future you can enable script to generate proper cmd checksum
#
@danasf
danasf / index.html
Last active September 10, 2021 13:05
Firmata & Arduino Examples
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Arduino connectivity test</title>
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
@danasf
danasf / MultiStripRainbow.ino
Last active August 29, 2015 13:58
Rainbow LEDs for multiple strips
#include "FastLED.h"
// number of strips
#define NUM_STRIPS 3
// number of lights per strip, if equal
#define NUM_LEDS 2
struct CRGB leds1[NUM_LEDS];
struct CRGB leds2[NUM_LEDS];
@danasf
danasf / README
Last active August 29, 2015 13:57
Web socket LED control
Experimenting with web sockets to control LEDs over a serial connection.
index.html - Client
server.js - Server
SerCmdLED.ino - arduino code, we can treat this like a black box, here is the interface:
set all to:
RED
GREEN
@danasf
danasf / readbytes.ino
Last active August 29, 2015 13:57
BLE!!!!
// THIS SKETCH WORKS!
#include <OctoWS2811.h>
#define BTSERIAL Serial2
#define DEBUG true
#define NUM_BYTES (17*3)
int i=0;
byte inBytes[NUM_BYTES];
boolean stringComplete = false;
uint32_t hexcolor;
@danasf
danasf / tictactoe.html
Created February 18, 2014 19:01
Tic-Tac-Toe
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Tic Tac Toe</title>
<link href='http://fonts.googleapis.com/css?family=Orbitron:400,700' rel='stylesheet' type='text/css'>
<style>
body { background:#000; color:#00ff00; margin: 0px; padding: 0px; font-family: "Orbitron","Helvetica","Arial","Sans-serif";}
h1 { font-weight: 700; font-size: 3em; }
button { font-family: "Orbitron","Helvetica","Arial","Sans-serif"; background:#000; color:#00FF00; border:1px solid #00FF00; padding:7px;}