This file contains hidden or 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
/****************************************************************************** | |
servo-skatch.ino | |
Example sketch for connecting a hobby servo to a sparkfun redboard | |
(https://www.sparkfun.com/products/9065) | |
(https://www.sparkfun.com/products/12757) | |
Byron Jacquot@ SparkFun Electronics | |
May 17, 2016 | |
**SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).** |
This file contains hidden or 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
/* | |
SparkFun Inventor’s Kit | |
Circuit 1C-Photoresistor | |
Use a photoresistor to monitor how bright a room is, and turn an LED on when it gets dark. | |
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community. | |
This code is completely free for any use. | |
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40 |
This file contains hidden or 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
/* | |
SparkFun Inventor’s Kit | |
Circuit 1C-Photoresistor | |
Use a photoresistor to monitor how bright a room is, and turn an LED on when it gets dark. | |
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community. | |
This code is completely free for any use. | |
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40 |
This file contains hidden or 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 "Wire.h" | |
#include <Sparkfun_APDS9301_Library.h> | |
APDS9301 apds; | |
#define INT_PIN 2 // We'll connect the INT pin from our sensor to the | |
// INT0 interrupt pin on the Arduino. | |
bool lightIntHappened = false; // flag set in the interrupt to let the | |
// mainline code know that an interrupt occurred. | |
int threshold = 26; |
This file contains hidden or 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
// We'll use SoftwareSerial to communicate with the XBee: | |
#include <SoftwareSerial.h> | |
//For Atmega328P's | |
// XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX) | |
// XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX) | |
SoftwareSerial XBee(2, 3); // RX, TX | |
//For Atmega2560, ATmega32U4, etc. |
This file contains hidden or 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
/* | |
OpenLCD is an LCD with Serial/I2C/SPI interfaces. | |
By: Nathan Seidle | |
SparkFun Electronics | |
Date: November 12th, 2015 | |
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). | |
OpenLCD gives the user multiple interfaces (serial, I2C, and SPI) to control an LCD. SerLCD was the original | |
serial LCD from SparkFun that ran on the PIC 16F88 with only a serial interface and limited feature set. | |
This is an updated serial LCD. |
This file contains hidden or 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 ledPin = 13; | |
void setup() { | |
pinMode(ledPin, OUTPUT); | |
for (int i = 0; i < 3; i++) { | |
digitalWrite(ledPin, HIGH); | |
delay(50); | |
digitalWrite(ledPin, LOW); |
This file contains hidden or 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
/* Modified FastLED example to stress test power supplies | |
* by using long lengths of LED strips and setting brightness | |
* to max. This was used in the Mean Well LED Switching Power | |
* Supply Hookup Guide on WS2812-based LEDs. | |
* | |
* https://learn.sparkfun.com/tutorials/mean-well-led-switching-power-supply-hookup-guide/ | |
* | |
* However, it can be be used on other addressable | |
* LED chipsets by adjusting the LED_type. | |
*/ |
This file contains hidden or 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
/* Arduino.cc RGB Crossfade | |
https://www.arduino.cc/en/Tutorial/ColorCrossfader | |
Modified by Bobby with Custom Color Mixing | |
https://learn.sparkfun.com/tutorials/lilypad-protosnap-plus-activity-guide/3-custom-color-mixing | |
https://learn.sparkfun.com/tutorials/picobuck-hookup-guide-v12 | |
Code for cross-fading 4 LEDs, red, green, blue, and white (RGBW) | |
To create fades, you need to do two things: | |
1. Describe the colors you want to be displayed | |
2. List the order you want them to fade in |
This file contains hidden or 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 "pitches.h" // must include open source pitches.h found online in libraries folder or make a new tab => https://www.arduino.cc/en/Tutorial/toneMelody | |
int button1State = LOW; | |
void setup() { | |
pinMode(4, INPUT_PULLUP); | |
pinMode(5, OUTPUT); | |
} |