/* Author: Elena C. K. Description: Attiny84 to control DotStar LED strip from Adafruit. It only have enough byte to control approximately 32 LEDs. Use the FastLED library to program. IDE Attiny84 Physical Pin 0 PA0 13 - TX 1 PA1 12 - RX 2 PA2 11 - OPAMP OUT 3 PA3 10 4 PA4 9 5 PA5 8 6 PA6 7 7 PA7 6 - D1 8 PB2 5 - C1 9 PB1 3 10 PB0 2 */ #include #define LED_DT 7 // Serial data pin #define LED_CK 8 // Serial clock pin for APA102 or WS2801 #define COLOR_ORDER BGR // It's GRB for WS2812B #define LED_TYPE APA102 // What kind of strip are you using (APA102, WS2801 or WS@2812B #define NUM_LEDS 72 #define MIC 2 #define DC_OFFSET 512 #include #define RX 1 #define TX 0 CRGB leds[NUM_LEDS]; SoftwareSerial Serial(TX, RX); void setup() { Serial.begin(9600); pinMode(MIC, INPUT); } void loop() { int sample = 0; // Current sample. Starts with negative values, which is why it's signed. sample = analogRead(MIC) - DC_OFFSET; sample = abs(sample); Serial.println(sample); }