This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am shfitz on github. | |
* I am shfitz (https://keybase.io/shfitz) on keybase. | |
* I have a public key whose fingerprint is 0D13 514B 3961 212A 9869 C66F 861B A4D9 AE02 D6F6 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Creates a randomly sparkling effect on an arbitrary number of | |
LEDs using the WS2812 driver. | |
*/ | |
#include <Adafruit_NeoPixel.h> // include the neopixel library | |
// most people use FastLED for the blinkytape, but the Adafruit | |
// library is more my speed | |
#define PIN 13 // we're using the blinkytape, data is pin 13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// demonstrates sending a value from an arduino to p5js | |
// which inicates if a switch is pressed or not | |
// a switch is wired to pin 2 with a 10K pulldown resistor in parallel | |
const int switchPin = 2; // pin the switch is connected to | |
int switchVal = 0; // variable to hold the value from the switch | |
void setup() { | |
// set pin as input | |
pinMode(switchPin, INPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// demonstrates sending a value from an arduino to p5js | |
// which inicates the position of a potentiometer connected to pin A0 | |
const int potPin = A0; // pin the pot is connected to | |
int potVal = 0; // variable to hold the value from the sensor | |
void setup() { | |
// initialize the serial communication: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int ledPin = 3; // the pin that the LED is attached to | |
void setup() { | |
// initialize the serial communication: | |
Serial.begin(9600); | |
// initialize the ledPin as an output: | |
pinMode(ledPin, OUTPUT); | |
} | |
void loop() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int firstSensor = 0; // first analog sensor | |
int secondSensor = 0; // second analog sensor | |
int thirdSensor = 0; // digital sensor | |
int inByte = 0; // incoming serial byte | |
void setup() { | |
// start serial port at 9600 bps and wait for port to open: | |
Serial.begin(9600); | |
while(!Serial){ | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include the neopixel library | |
#include <Adafruit_NeoPixel.h> | |
int ledPin = 3; // the pin the LED data line is connected to | |
int numLED = 5; // number of LEDs you are controlling | |
// call the constructor | |
Adafruit_NeoPixel leds(numLED, ledPin, NEO_GRB + NEO_KHZ800); | |
// variables to hold colors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include the neopixel library | |
#include <Adafruit_NeoPixel.h> | |
int ledPin = 3; // the pin the LED data line is connected to | |
int numLED = 5; // number of LEDs you are controlling | |
// call the constructor | |
Adafruit_NeoPixel leds(numLED, ledPin, NEO_GRB + NEO_KHZ800); | |
int sensorPin = A0; // pin the sensor is attached to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Creates a randomly sparkling effect on an arbitrary number of | |
LEDs using the WS2812 driver. | |
*/ | |
#include <Adafruit_NeoPixel.h> // include the neopixel library | |
// most people use FastLED for the blinkytape, but the Adafruit | |
// library is more my speed | |
#define PIN 3 // we're using the blinkytape, data is pin 13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include the neopixel library | |
#include <Adafruit_NeoPixel.h> | |
int ledPin = 3; // the pin the LED data line is connected to | |
int numLED = 5; // number of LEDs you are controlling | |
// call the constructor for the neopixels | |
Adafruit_NeoPixel leds(numLED, ledPin, NEO_GRB + NEO_KHZ800); | |
int input[] = {0, 0, 0}; // an array to hold color data |
OlderNewer