The electric ukulele
Description
This is an electric ukulele. The body and neck are fully printed. Inside, the ukulele is supported by an aluminum rail. The coils for the pickups are self-wound. Additionally, a microcontroller analyzes the tones and plays a light show on the transparent body. #Material: Transparent filament for the body Multicolor filament for the neck Threaded insert M3 Screws M3 (8mm) RGB LED WS2812 144Pixel/m (1m) ESP8266 microcontroller Two potentiometers (M7, 500 Ohm) Magnets (Radius 3mm, Height 2mm), around 100 pieces Cables Super glue Enamelled copper wire (0.3mm, 20m) Aluminum wire (2mm, 1m) Rectangular aluminum profile (10mm x 4mm x 100mm) Aluminum U-profile (10x10x10x2mm, 48cm) Jack coupling (6.3mm) Guitar tuning pegs (3R, 3L) Nickel wound electric guitar strings #Code for the ESP8266 via Arduino IDE: '#define analogPin A0 '#include <Adafruit_NeoPixel.h> Adafruit_NeoPixel pixels = Adafruit_NeoPixel(99,4, NEO_GRB + NEO_KHZ800); static byte numPixel = 96; byte pixelColor[96][3]; float analogValue = 0; int lastAnalyse = millis(); byte dataLength = 180; float data[180]; byte dataPosition = 0; float distance = 0; float amplitude = 0; void setup() { Serial.begin(115200); for(byte i=0;i<numPixel;i++){ pixelColor[i][0]=0; //red pixelColor[i][1]=0; //green pixelColor[i][2]=0; //blue } pixels.begin(); pixelColor[0][0]=50; //red pixelColor[0][1]=50; //green pixelColor[0][2]=250; //blue } void loop() { if(dataPosition < dataLength){ data[dataPosition] = analogRead(analogPin); dataPosition++; }else { dataPosition = 0; byte maxPosition = 0; byte minPosition = 0; for(byte i=0;i<dataLength;i++){ if(data[maxPosition]<data[i]){ maxPosition = i; } if(data[minPosition]>data[i]){ minPosition = i; } } if(maxPosition>minPosition){ distance = maxPosition - minPosition; }else{ distance = minPosition - maxPosition; } amplitude = data[maxPosition] - data[minPosition]; if(amplitude > 10){ Serial.print("distance: "); Serial.println(distance); Serial.print("amplitude: "); Serial.println(amplitude); } if(amplitude > 11){ byte intensity = 0; if(amplitude < 25){ intensity = amplitude*8; }else{ intensity = 255; } if(distance<dataLength*0.2){ pixelColor[0][0]=intensity; //red pixelColor[0][1]=0; //green pixelColor[0][2]=0; //blue } else if(distance<dataLength*0.3){ pixelColor[0][0]=intensity; //red pixelColor[0][1]=intensity/2; //green pixelColor[0][2]=0; //blue }else if(distance<dataLength*0.4){ pixelColor[0][0]=0; //red pixelColor[0][1]=intensity; //green pixelColor[0][2]=0; //blue }else if(distance<dataLength*0.5){ pixelColor[0][0]=0; //red pixelColor[0][1]=intensity; //green pixelColor[0][2]=intensity; //blue }else if(distance<dataLength*0.6){ pixelColor[0][0]=0; //red pixelColor[0][1]=0; //green pixelColor[0][2]=intensity; //blue }else { pixelColor[0][0]=intensity; //red pixelColor[0][1]=0; //green pixelColor[0][2]=intensity; //blue } }else{ pixelColor[0][0]=0; //red pixelColor[0][1]=0; //green pixelColor[0][2]=0; //blue } pixelStep(); pixels.show(); } } void pixelStep(){ for(byte i=1;i<numPixel;i++){ pixelColor[numPixel-i][0]=pixelColor[numPixel-i-1][0]; //red pixelColor[numPixel-i][1]=pixelColor[numPixel-i-1][1]; //green pixelColor[numPixel-i][2]=pixelColor[numPixel-i-1][2]; //blue } for(byte i=0;i<numPixel;i++){ pixels.setPixelColor(i,pixels.Color(pixelColor[i][0],pixelColor[i][1],pixelColor[i][2])); } }
Statistics
Likes
0
Downloads
0