Home / 3D Prints / Misc Prints / Mana Skull 1
I saw this and just thought it was too cool to pass up. Some White Marble PLA, a couple of blue LEDs, a couple of resistors, an Arduino nano and a cheap 5v usb nano humidifier board. Solder a few wires, add some water and power and reap the mana!
https://photos.app.goo.gl/5dzB9YqiEefAABSq6
I used the white marble since it was what I had readily avaiable at the moment. Stocks are low right now in the workshop. Been a printing fool all summber long. ;-)
This is the Arduino code for the Nano board controlling the LEDs and providing power for the humidifier board as well.
int ledPin1 = 9; // First PWM-capable pin for the first LED
int ledPin2 = 10; // Second PWM-capable pin for the second LED
unsigned long previousMillis = 0;
const long interval = 10; // Interval for updates
void setup() {
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
}
void loop() {
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
// Calculate the brightness for the first LED
float brightness1 = (sin(currentMillis * 0.0006 * PI) + 1.0) / 2.0;
brightness1 = brightness1 * 0.4 + 0.2;
int analogValue1 = int(brightness1 * 255);
analogWrite(ledPin1, analogValue1);
// Calculate the brightness for the second LED
// If you want the second LED to fade in sync with the first, use the same calculation
// If you want it to be offset, you can add a phase shift to the sine function
float brightness2 = (sin((currentMillis * 0.0006 * PI) + PI) + 1.0) / 2.0; // Adding PI for 180 degrees phase shift
brightness2 = brightness2 * 0.4 + 0.2;
int analogValue2 = int(brightness2 * 255);
analogWrite(ledPin2, analogValue2);
}
}
Same Humidifier board as the creator was used, while I was on ALI I piked up a few more inexpensive Arduino Nanos.
https://www.aliexpress.us/item/3256805515889671.html
|
||