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 <Adafruit_NeoPixel.h> | |
#define PIN 2 | |
#define Pixels 24 | |
#define BG 1 | |
// Parameter 1 = number of pixels in strip | |
// Parameter 2 = Arduino pin number (most are valid) | |
// Parameter 3 = pixel type flags, add together as needed: | |
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) |
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
/* | |
IoT Manager mqtt device client https://play.google.com/store/apps/details?id=ru.esp8266.iotmanager | |
Based on Basic MQTT example with Authentication | |
PubSubClient library v 1.91.1 https://github.com/Imroy/pubsubclient | |
- connects to an MQTT server, providing userdescr and password | |
- publishes config to the topic "/IoTmanager/config/deviceID/" | |
- subscribes to the topic "/IoTmanager/hello" ("hello" messages from mobile device) | |
Tested with Arduino IDE 1.6.6 + ESP8266 Community Edition v 2.0.0-stable and PubSubClient library v 1.91.1 https://github.com/Imroy/pubsubclient | |
ESP8266 Community Edition v 2.0.0-stable have some HTTPS issues. Push notification temporary disabled. |
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
// as showed on youtube | |
void noise_audio2() { | |
read_audio(); | |
CRGBPalette16 Pal( pit3 ); // the red one | |
y[0] += (bands[4] - 10) * 4; | |
scale_x[0] = 10000 - (bands[0] * 40); | |
scale_y[0] = scale_x[0]; | |
byte layer = 0; | |
for (uint8_t i = 0; i < Width; i++) { | |
uint32_t ioffset = scale_x[layer] * (i - CentreX); |
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
#define LED_LATCH 7 | |
#define LED_CLOCK 8 | |
#define LED_DATA 9 | |
byte matrix[64] { | |
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //1 | |
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //2 | |
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //4 | |
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //6 | |
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //8 |
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
// This site could be helpful: http://www.binaryhexconverter.com/binary-to-decimal-converter | |
#define data_pin 12 | |
#define latch_pin 13 | |
#define clock_pin 14 | |
void setup() | |
{ | |
int shift = 0; | |
Serial.begin(9600); | |
pinMode(data_pin, OUTPUT); |
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
/* | |
I recently got one of those 8x8 LED matrices and I was playing with some Game of Life patterns when I found this pretty repeating pattern. I found it by starting with some random patterns. If you look closely you can see the pattern becoming a mirrored version of itself halfway through. Apparently the pattern doesn't repeat like this on an infinite grid but on this wrapping 8x8 grid it does ;-) | |
FYI, the LED matrix is a bicolor one (green/red) and has an I2C interface (http://www.adafruit.com/products/902). I'm using the colors as follows: | |
- newly created cells are green | |
- cells that are at least 10 generations old are red | |
- other living cells are yellow (simultaneously green+red) | |
It's hookup up to my Arduino Uno r3. |
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
/* | |
YouTube Video Link: https://youtu.be/oCWGiHfL3NY | |
Schematic: https://goo.gl/photos/wKB94DZT4ECusWmcA | |
This mushroom Lights project is built using a TCRT5000 infrared LED/transistor pair. | |
For the infrared LED, a 100ohm resistor is connected in series with +5v and the LED. | |
A 4.7k resistor connected in series between +5v and the emitter of the transistor. | |
Analog pin A1 (pin 2 on digispark) is connected to the emitter of the transistor. | |
I'm assuming the project is switched off at least once every 50 days so the millis() does not overflow back to zero. | |
*/ | |
const uint8_t MUSHPIN [] = {0,1,4}; //PWM pins on the Digispark. Connect the infrared sensor to pin 2 (=A1) |