AN APPLICATION BASED ON FIREBEETLE ESP32: a SLOW DANCE PICTURE FRAME
by JFJAVENUE in Workshop > 3D Printing
1200 Views, 2 Favorites, 0 Comments
AN APPLICATION BASED ON FIREBEETLE ESP32: a SLOW DANCE PICTURE FRAME
It’s not the lack of beauty in life, but the lack of the eyes to find the beauty. However,we are busy in working and living, finally the high speed lifestyle leads to numb eyes. Therefore, I created a picture frame called ‘Slow Down’which helps you relief your eyes to enjoy happiness of birdsong, flowers and even a feather….
Do you remember a sloth called Flash in the movie ‘Zootopia’? His slow actions really make everyone go crazy! Imaging how slowly he is, so does the slow dance picture frame! Once you put a feather, a flower, or a leaf to the frame, it will dance with much grace, swaying so silently and so slowly like slow motions as we seen in the movies. When you look at the frame, the time stops, the magic dance makes you forget about abundant tasks and worries, absorbing in the silent pleasure.
Hereby, I made an application based on Firebeetle ESP32 - a slow dance picture frame. Firstly, here is the accomplished object.
Preparation
Stuffs in need:
12V 1A power supply
Wooden frame (depth:35mm, about 10 inch)
steel spring plats(depth: 0.3mm)
Iron bars/ screws/nails(length: about 60mm)
Enameled copper wires(0.41mm)
Magnet ×2
Hot melt adhesive
Electronic products in need:
12V 1A power supply module
MOSFET DC switch ×2
3D designing:
I have printed a cannon model with 3D printer to hide coils. It looks better to twist copper coils to the surface of traverse and plug the core to the middle. (You can also twist coils to the core.)
Operating process
Prepare Coils.
Take and twist enameled copper wires to surface of traverse for about 4 to 5 layers. After the twist, plug the prepared core to coils.
Allocate LEDs to Inner Part of the Frame.
Divide LEDs belt to 3 parts, every part of 60cm and solders them in parallel.
Stick up the LED belt to the inner part of the frame.
Connect Electronic Modules.
Connect 6 parts according to the image as below:
The image of connected modules, shown as below:
Assemble and Install.
In the beginning, fix electronic modules to the frame.
Then, fix steel spring plats and connect coils.
Finally, cover electronic modules with 3D printing crust.
The accomplishment of assemble and install
Download Programs in Need.
CODE: SELECT ALL
//Use the first channel and the last channel of 16 channels
#define LEDC_CHANNEL_0 0
#define LEDC_CHANNEL_15 15
//Use 13 timing precision timing
#define LEDC_TIMER_13_BIT 13
//Use 90Hz and 89Hz respectively to control LED lights and electromagnets
#define LEDC_BASE_FREQ1 90
#define LEDC_BASE_FREQ2 89
//Define pin25 and pin26 respectively to control LED lights and electromagnets
#define LED_PIN1 25
#define LED_PIN2 26
//The channel takes the space ratio setting function, whose value must be between 0 and 255.
void ledcAnalogWrite(uint8_t channel, uint32_t value, uint32_t valueMax = 255) {
uint32_t duty = (8191 / valueMax) * min(value, valueMax); //calculate duty, 8191 from 2 ^ 13 - 1 ledcWrite(channel, duty);//Set the channel to fill the void ratio
}
//LED lights are flipped every 500 milliseconds.
void flash()
{
static boolean output = LOW;
digitalWrite(LED_BUILTIN, output);
output = !output;
}
void setup() {
//Set the PWM channel 0 to the pin25 pins and set the timer for 13 timing precision
//The frequency is set to 90Hz
ledcSetup(LEDC_CHANNEL_0, LEDC_BASE_FREQ1, LEDC_TIMER_13_BIT);
ledcAttachPin(LED_PIN1, LEDC_CHANNEL_0);
//Set the channel 0 to account for 60
ledcAnalogWrite(LEDC_CHANNEL_0, 60);
//Set PWM wave channel 15 to pin26 pin and set timer for 13 timing precision
//The frequency is set to 89Hz
ledcSetup(LEDC_CHANNEL_15, LEDC_BASE_FREQ2, LEDC_TIMER_13_BIT);
ledcAttachPin(LED_PIN2, LEDC_CHANNEL_15);
//Set the channel 15 to account for 60
ledcAnalogWrite(LEDC_CHANNEL_15, 60);
//Light up the work indicator light
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
}
void loop() {
//The LED is reversed once every 500ms, indicating that the program is running normally
while(1){
flash();
delay(500);
}
}
read original artical:https://www.dfrobot.com/forum/viewtopic.php?f=2&t=2883