Digital Windmill “Digindmill”
I made a digital Windmill “Digindmill” that breathes and rotates.
目次
Constitution
The microphone takes a breath and senses the sound and controls the LED’s emission.
The rotation speed changes depending on the volume.
Parts List
- Arduino Nano clone product
- High sensitivity MIC amplifier kit
- LED Tape Neopixel
Production process
Use a 100-uniformly polypropylene sheet for feathers
I used the thing of the Pikopico Hammer of 100 to handle it:-).
Wire it in. Completed!
Operation
View this post on InstagramDigital Windmill 1 #led #neopixel Https://homemadegarbage.com/digindmill
View this post on InstagramDigital Windmill 2 #led #neopixel Https://homemadegarbage.com/digindmill
It’s beautiful!
Code for Arduino IDE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
#include<Adafruit_NeoPixel.h></Adafruit_NeoPixel.h> #ifdef __AFR__ #include<avr ower.h=""></avr> #endif const int analoginpin = A1; int sensorvalue = 0; int amp = 0; int rotdelay = 500; int fin = 0; Kazaguruma Feather Hai led setting #define Numpixels 5 Adafruit_neopixel pixel0 = Adafruit_neopixel (Numpixels, 2, NEO_GRB + NEO_KHZ800); Adafruit_neopixel Pixel1 = Adafruit_neopixel (Numpixels, 3, NEO_GRB + NEO_KHZ800); Adafruit_neopixel Pixel2 = Adafruit_neopixel (Numpixels, 4, NEO_GRB + NEO_KHZ800); Adafruit_neopixel pixel3 = Adafruit_neopixel (Numpixels, 5, NEO_GRB + NEO_KHZ800); Adafruit_neopixel Pixel4 = Adafruit_neopixel (numpixels, 6, NEO_GRB + NEO_KHZ800); Adafruit_neopixel Pixel5 = Adafruit_neopixel (numpixels, 7, NEO_GRB + NEO_KHZ800); Adafruit_neopixel pixel6 = Adafruit_neopixel (Numpixels, 8, NEO_GRB + NEO_KHZ800); Adafruit_neopixel Pixel7 = Adafruit_neopixel (numpixels, 9, NEO_GRB + NEO_KHZ800); Adafruit_neopixel pixels [8] = {pixel0, pixel1, Pixel2, Pixel3, Pixel4, Pixel5, Pixel6, PIXEL7}; uint32_t fincolors [8]; void Setup () { Serial.begin (9600); #if defined (__avr_atiny85__) if (f_cpu = = 16 million) Clock_prescale_set (clock_div_1); #endif for (int i = 0; i< 8; i++ ){ 8;="" i++=""></ 8; i++ ){> pixels [i]. Begain (); pixels [i]. ssetrigness (20); } Feather Color Setting fincolors [0] = pixels [0]. Color (255, 0, 0); fincolors [1] = pixels [0]. Color (150150150); fincolors [2] = pixels [0]. Color (85, 0170); fincolors [3] = pixels [0]. Color (120155, 0); fincolors [4] = pixels [0]. Color (0, 0255); fincolors [5] = pixels [0]. Color (170, 0, 85); fincolors [6] = pixels [0]. Color (0255, 0); fincolors [7] = pixels [0]. Color (0170170); } void Loop () { Mic output averaging for (int i = 0; i< 10; i++){ 10;=""></ 10; i++){> Sensorvalue = + analogread (analoginpin); } Serial.print (Sensorvalue/10); Mic output bias Removal AMP = ABS (Sensorvalue/10-30); Serial.print (""); Serial.print (AMP); Rotational speed derivation from mic output Rotdelay = Map (AMP, 10, 60, 150, 0); if (rotdelay< 0){></ 0){> Rotdelay = 0; } Serial.print (""); Serial.println (Rotdelay); for (int j = 0; j< 8; j++){ 8;=""></ 8; j++){> int k = j + fin; if (k > = 8) { K = k-8; } for (int i = 0; i< 5; i++){ 5;=""></ 5; i++){> Pixels [j]......... (I, fincolors [K]); } } for (int i = 0; i< 8; i++ ){ 8;="" i++=""></ 8; i++ ){> pixels [i]. .show (); } Delay (15); The mic output is rotated at a certain level if (Amp > 10) { Delay (Rotdelay); Fin + +; if (Fin > = 8) { Fin = fin-8; } } for (int i = 0; i< 8; i++ ){ 8;="" i++=""></ 8; i++ ){> pixels [i]. .clear (); pixels [i]. .show (); } |
Append
I was introduced on the official page of Adafruit!