Catia Diaz
MEXICO • + Follow
Edit Project
Tools, APP Software Used etc.
|
Soldering Iron Wire |
|
|
Soldering Iron Kit |
Description
Números aleatorios para dinámicas divertidas de participación
Lista de materiales completa:
5 Borneras de 2 terminales cada una
2 Cap 100n (SMD 1206)
2 Resistencias de 10k (SMD 1206)
2 Porta pilas para pila 18650
1 Regulador de voltaje SMD LM1117
1 tira de 5 pines
1 Buzzer (SMD 9650)
1 ESP32 C3 super mini
Mas detalles en el video tutorial
Code
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
// Configuración de la matriz
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4 // Número de módulos en la matriz (4 módulos = 32 LEDs de ancho)
#define DIN_PIN 6
#define CS_PIN 7
#define CLK_PIN 4
MD_Parola matrix = MD_Parola(HARDWARE_TYPE, DIN_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
// Configuración del botón
#define BUTTON_PIN 5 // Boton 1
#define BUZZER_PIN 3 // Pin donde está conectado el buzzer
bool buttonState = false; // Estado actual del botón
bool lastButtonState = false; // Estado previo del botón
bool slowingDown = false; // Indica si está en modo de frenado
// Variables para el conteo
int currentNumber = 0; // Número actual mostrado en la matriz
unsigned long lastTime = 0; // Controla el tiempo para el conteo
unsigned long delayTime = 100; // Tiempo inicial entre números (100 ms)
int stopAfterCount = 6; // Números restantes antes de detenerse
int slowCount = 0; // Contador de números mostrados durante el frenado
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP); // Configura el botón con resistencia interna
pinMode(BUZZER_PIN, OUTPUT); // Configura el pin del buzzer como salida
matrix.begin(); // Inicializa la matriz
matrix.setIntensity(4); // Configura el brillo (0 a 15)
matrix.displayClear(); // Limpia la matriz
matrix.setTextAlignment(PA_CENTER); // Alinea el texto al centro
}
void loop() {
// Leer el estado del botón
bool reading = !digitalRead(BUTTON_PIN); // Botón activo bajo
// Detectar flanco de presión del botón
if (reading && !lastButtonState) {
if (!buttonState) { // Si el conteo estaba detenido
buttonState = true; // Iniciar conteo rápido
delayTime = 100; // Restablecer velocidad rápida
// Emitir pitido por 350 ms
digitalWrite(BUZZER_PIN, HIGH); // Encender el buzzer (sonido)
delay(350);
digitalWrite(BUZZER_PIN, LOW); // Apagar el buzzer
} else { // Si el conteo estaba corriendo
slowingDown = true; // Iniciar frenado
stopAfterCount = 6; // Configurar los números restantes a 6
slowCount = 0; // Reiniciar contador del frenado
// Emitir un pitido corto
digitalWrite(BUZZER_PIN, HIGH); // Encender el buzzer
delay(100); // Esperar 100 ms
digitalWrite(BUZZER_PIN, LOW); // Apagar el buzzer
}
delay(350); // Evitar rebotes
}
lastButtonState = reading;
if (buttonState && !slowingDown) {
// Conteo rápido
if (millis() - lastTime >= delayTime) {
lastTime = millis();
displayNumber(currentNumber);
currentNumber++; // Avanzar al siguiente número
// Reiniciar si llegamos a 25
if (currentNumber > 24) currentNumber = 1;
}
} else if (slowingDown) {
// Frenado progresivo
if (millis() - lastTime >= delayTime) {
lastTime = millis();
displayNumber(currentNumber);
currentNumber++; // Avanzar al siguiente número
// Reiniciar si llegamos a 25
if (currentNumber > 24) currentNumber = 1;
slowCount++; // Incrementar el contador de números mostrados
delayTime += 150; // Incrementar más el tiempo entre números (ralentización)
// Detener después de mostrar 6 números
if (slowCount >= stopAfterCount) {
slowingDown = false; // Finalizar frenado
buttonState = false; // Detener conteo
// Emitir 5 pitidos cortos
for (int i = 0; i < 5; i++) {
digitalWrite(BUZZER_PIN, HIGH); // Encender el buzzer
delay(100); // Esperar 100 ms
digitalWrite(BUZZER_PIN, LOW); // Apagar el buzzer
delay(100); // Esperar 100 ms entre pitidos
}
}
}
}
}
// Función para mostrar un número en la matriz
void displayNumber(int number) {
char buf[3]; // Buffer para convertir número a texto
sprintf(buf, "%02d", number); // Formato 2 dígitos
matrix.displayClear(); // Limpia la matriz
matrix.print(buf); // Mostrar el número en la matriz
matrix.displayAnimate(); // Actualizar la animación
}
Schematic and Layout
Nov 29,2024
30 views
Números aleatorios para dinámicas divertidas de participación
2 Layers PCB 72 x 81 mm FR-4, 1.6 mm, 1, HASL lead free, Green Solder Mask, White silkscreen
Con esta tarjeta podrás conectar un buzzer, pilas 18650 y un Esp 32 C3 super mini para programar una matriz de 8 x 64 leds
30
0
0
Published: Nov 29,2024
Download Gerber file 0
Purchase
Donation Received ($)
PCBWay Donate 10% cost To Author
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
Copy this HTML into your page to embed a link to order this shared project
Copy
Under the
Attribution-ShareAlike (CC BY-SA)
License.
- Comments(0)
- Likes(0)
Upload photo
You can only upload 5 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000
It looks like you have not written anything. Please add a comment and try again.
You can upload up to 5 images!
Image size should not exceed 2MB!
File format not supported!
View More
View More
VOTING
0 votes
- 0 USER VOTES
0.00
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Design
1/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Usability
2/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Creativity
3/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Content
4/4
More by Catia Diaz
- Led strip 5630 SMD with screw terminal This project is designed for 2 things. The first is so that people can practice soldering SMD compon...
- Números aleatorios para dinámicas divertidas de participación Lista de materiales completa:5 Borneras de 2 terminales cada una2 Cap 100n (SMD 1206)2 Resistencias ...
- Numeros aleatorios matriz- Se trata de una PCB con esp32 que permite controlar una matriz de leds ws2812bLista de materiales co...
- Esp 32 wireless communication card Here you can see more details of the programming process
- Card for LED light sequence and memory game Here you can find the complete tutorial to see how this game works.Characteristics of the assembly o...
- Timer with 5-position selector and ESP 32 C3 super mini Full tutorial in the following video
- USB Charger Its a charger with a 7 segments display to stop with the time the charge, its controlled with a esp3...
- PCB for charging AA rechargeable batteries With this card you can charge from 1 to 5 AA batteries independently. With the charger you can selec...
- H bridge module to control crank With the help of this H-bridge circuit we can control the rotation of a motor, and better yet, if we...
- Design to control 7 segment display with switches One way to connect a 7-segment display is using cables and switches.In order to form a number you wi...
- Wireless control for motor dc It is a pair of PCBs that allow transmitting a signal that is sent through 4 buttons and received by...
- Led lamp replacement This is a replacement for lamps commonly used in the ceiling.These lamps, being cheap, break down ea...
- 2835 SMD led strip for students One application that I gave to this circular LED strip is to illuminate a beverage counter.Use only ...
- Cube to make infinite led cube This effect will be achieved thanks to the use of mirrors and light, I used mirror glass and an LED ...
- Card to control intensity of LED strips If you want more details of the plate and an example of use, in this tutorial you can see the result...
- Double H Bridge with L9110 Integrated Circuit With the help of this card with 2 H bridges, we can change the rotation of geared motors.In addition...
- charger for 6 AA batteries Here you can see a tutorial where it is explained how to use the Imax B6 charger together with the P...
- Micro led strip 2835 of 12 volts Use this strip to have its intensity controlled with an RF controlSo you can find the arduino code t...
You may also like
-
An Analog Hardware Project Including NE555 Timer
27 0 0 -
STM32F405RGT6 - Dual BLDC Motor Controller for Swerve Drive
30 0 1 -
G-EDM EVOIII board - Low budget DIY Wire EDM machine
42 0 0 -
-
-
-
-
-
X-mas ball, Now with ANIMATED LIGHTS!
127 5 7 -