--- /dev/null
+#include <Adafruit_NeoPixel.h>
+#define NUM_PIXELS 10
+#define PIN 12
+Adafruit_NeoPixel strip(NUM_PIXELS, PIN, NEO_GRB);
+
+#define BTN 2
+
+uint8_t colorToggle = 0;
+
+void changeColor();
+
+#define A1 5
+#define A2 6
+#define EN1 13
+
+#define POT A3
+
+uint16_t count = 0;
+
+void setup()
+{
+ strip.begin();
+ //changeColor();
+ pinMode(2, INPUT_PULLUP);
+ attachInterrupt(digitalPinToInterrupt(BTN), changeColor, FALLING);
+
+ pinMode(POT, INPUT);
+ pinMode(A1, OUTPUT);
+ pinMode(A2, OUTPUT);
+ pinMode(EN1, OUTPUT);
+ digitalWrite(EN1, HIGH);
+
+ TCCR1A = 0;
+ TCCR1B = 0;
+ TCNT1 = 0;
+ OCR1A = 0;
+ OCR1B = 0;
+ ICR1 = 0;
+ TIMSK1 = 0;
+ TIFR1 = 0;
+
+ TCCR1A |= (1 << WGM11) | (1 << COM1B1);
+ TCCR1B |= (1 << WGM12) | (1 << WGM13);
+ OCR1B = 781;
+ ICR1 = 1249;
+
+ TCCR1B |= (1 << CS10) | (1 << CS11);
+
+ //Serial.begin(115200);
+}
+
+void loop()
+{
+ uint16_t pot_value = analogRead(POT);
+ pot_value = map(pot_value, 0, 1023, 0, 255);
+ analogWrite(A1, pot_value);
+ digitalWrite(A2, LOW);
+}
+
+void changeColor()
+{
+ if (colorToggle == 1)
+ {
+ strip.setPixelColor(2, strip.Color(0, 255, 0));
+ colorToggle = 0;
+ }
+ else
+ {
+ strip.setPixelColor(2, strip.Color(255, 255, 255));
+ colorToggle = 1;
+ }
+ strip.show();
+}
+
+ISR(TIMER1_OVF_vect)
+{
+ count++;
+ //Serial.println(count);
+}