INFORMACIÓN
Los sistemas embebidos como Arduino, Pic u otros trabajan únicamente con lógica binaria (1 y 0) cuyos datos no son de fácil interpretación para los humanos, es por eso que para «leer» los datos usamos displays y pantallas. Este Modulo 4 digitos 7 segmentos TM1637 permite mostrar 4 dígitos en formato 7 segmentos. Ideal para ser utilizado como contador, reloj, indicador.
El Modulo 4 digitos 7 segmentos TM1637 posee 2 registros 74HC595 conectados a un display de 4 dígitos ánodo común. Para mostrar todos los dígitos encendidos es necesario utilizar una técnica de multiplexación: Encender un solo dígito a la vez y luego encender el siguiente, repitiendo el proceso rápidamente podemos «engañar» a nuestros ojos y lograr mostrar los 4 dígitos encendidos «en simultaneo».
Para trabajar con este display TM1637 solo se necesita conectar 3 pines (DATA, CLK, LATCH). Se pueden conectar más módulos en cascada y mostrar más datos, sin necesidad de utilizar más pines de Arduino.
ESPECIFICACIONES Y CARACTERÍSTICAS
- Voltaje de Operación: 3.3V – 5V
- Registros de desplazamiento: 74HC595
- Modelo de 7-seg: 0.36 4 ánodo común
- Dimensiones: 42 x 24 x 12 mm
- Peso: 8 g
- Conector de alimentación y control con solamente 4 pines:
- GND–tierra
- VCC–fuente de alimentación
- DIO–entrada y salida de datos
- CLK–señal de reloj
DOCUMENTACIÓN Y RECURSOS
INFORMACIÓN ADICIONAL
Para poder utilizar el modulo TM1647 requeriremos descargar e instalar la librería en el Arduino IDE y armar el siguiente circuito:
A continuación cargaremos el siguiente código:
/* TM1637.cpp A library for the 4 digit display Copyright (c) 2012 seeed technology inc. Website : www.seeed.cc Author : Frankie.Chu Create Time: 9 April,2012 Change Log : The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "TM1637.h" // Definición de pines para TM1637 const int CLK = 6; const int DIO = 7; TM1637 tm1637(CLK, DIO); float number = -1234.5; int mult = 1; void setup() { tm1637.init(); tm1637.set(BRIGHT_TYPICAL);//BRIGHT_TYPICAL = 2,BRIGHT_DARKEST = 0,BRIGHTEST = 7; float num = -123.45; // Sin especificar el punto decimal muestra entero tm1637.displayNum(num); // -123 delay(2000); // Cuando los números no caben, se cortanlos dígitos tm1637.displayNum(num, 1); // -234 delay(2000); // Dos puntos se iluminan como punto decimal tm1637.displayNum(num, 2); delay(2000); // Notese que añadiendo 3 dígitos (-123450) se sale del rango del entero tm1637.displayNum(num, 3); delay(2000); // Desplegar números negativos sin signo tm1637.displayNum(num, 0, false); delay(2000); } void loop() { tm1637.displayNum(number); number += 17.42 * mult; if (abs(number) > 1500) { mult *= -1; } delay(50); }
Valoraciones
No hay valoraciones aún.