Cree su propio teletipo de noticias Bluetooth
Colocado en
Suministros
Arduino Uno R3 - clon Agotado O un Arduino Nano € 11,50 Módulo de matriz de puntos MAX7219 4x Agotado Esta es la pantalla, necesitas al menos 1, ¡2 es aún mejor! € 10,20 Módulo Bluetooth HC-06 con adaptador - clon En stock Este es el esclavo Bluetooth HC-06, necesitas 1 € 8,50 Resistencia de película metálica de 5,6 KΩ 1/4 W - 100 piezas Agotado El divisor de voltaje para el módulo Bluetooth. € 1,45 Resistencia de película metálica 10KΩ 1/4W - 10 piezas En stock El divisor de voltaje para el módulo Bluetooth. € 1,75 Fuente de alimentación Mean well SGA12E09-P1J - 9V 1,33A Agotado Para energía adicional, USB no puede suministrar suficiente € 14,00 Toma CC incorporada 5,5 mm x 2,1 mm - 5 piezas En stock € 2,50 Total € 49,90El horario:
El esquema muestra cómo todo debe estar conectado. Si ya siente que todos esos cables dan vueltas, no mire demasiado el conjunto, pero intente considerar y conectar los módulos uno por uno. Verás que no está nada mal.El esquema muestra solo un módulo LED de matriz de puntos cuádruple, en realidad, ¡puede unir dos para obtener un ancho doble!

El módulo bluetooth requiere un poco de atención adicional. Las señales de comunicación Bluetooth (TX y RX) funcionan a 3,3 voltios, mientras que el Arduino funciona a 5 voltios. Las dos resistencias reducirán los 5 voltios de Arduino a unos 3,3 voltios.
La nutrición:
Puede ver que se utiliza una fuente de alimentación de 5 voltios. Tienes que. Un Arduino conectado a USB no puede suministrar suficiente corriente para alimentar la matriz LED, especialmente con una doble matriz.
La nutrición:
Puede ver que se utiliza una fuente de alimentación de 5 voltios. Tienes que. Un Arduino conectado a USB no puede suministrar suficiente corriente para alimentar la matriz LED, especialmente con una doble matriz.
Biblioteca Arduino y Sketch:
El boceto Arduino utiliza dos bibliotecas externas, para instalarlas, busque MD_MAX72xx en el administrador de bibliotecas. Luego instale MD_Max72xx y MD_Parola
Configure el módulo correcto:
Después de instalar las bibliotecas, debemos decirle a la biblioteca MD_Max72xx qué módulo de matriz LED estamos usando.
Localice el archivo en su disco duro: MD_MAX72xx.h
(probablemente en la carpeta C:\Usuarios\tu nombre\Documentos\ Arduino \bibliotecas\MD_MAX72XX\src\)
Después de instalar las bibliotecas, debemos decirle a la biblioteca MD_Max72xx qué módulo de matriz LED estamos usando.
Localice el archivo en su disco duro: MD_MAX72xx.h
(probablemente en la carpeta C:\Usuarios\tu nombre\Documentos\ Arduino \bibliotecas\MD_MAX72XX\src\)
x
//Op regel 214, zie je staan:
#define USE_PAROLA_HW 1, verander die 1 in 0
//Op regel 237 zie je staan:
#define USE_FC16_HW 0, verander die 0 in 1.
El boceto Arduino :
Entonces ahora podemos cargar el boceto.Copie el boceto y pegue el código en el software Arduino , seleccione el puerto com correcto, escriba Arduino y presione cargar.
xxxxxxxxxx
127
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include <SoftwareSerial.h>
#include <EEPROM.h>
#define MAX_DEVICES 8
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10
// Use softserial for the bluetooth module
SoftwareSerial mySerial(2, 3);
// HARDWARE SPI
MD_Parola LK = MD_Parola(CS_PIN, MAX_DEVICES);
uint8_t scrollSpeed = 30; // default frame delay value
textEffect_t scrollEffect = PA_SCROLL_LEFT;
textPosition_t scrollAlign = PA_LEFT;
uint16_t scrollPause = 2000; // in milliseconds
// Global message buffers shared by Serial and Scrolling functions
#define BUF_SIZE 75
char curMessage[BUF_SIZE];
char newMessage[BUF_SIZE];
bool newMessageAvailable = false;
void setup()
{
// Enable the next line to clear the message from eeprom.
// EEPROM.write(0,1);
mySerial.begin(9600);
delay(500);
// The next line configures the BT-04 (BT-06) Module to NOT report connection status.
mySerial.write("\r\nAT+ENABLEIND0\r\n");
delay(100);
ClearRXbuffer();
// change the name of the BT-04 (BT-06) device, this will not work for HC-06
mySerial.write("AT+NAMELichtkrant01\r\n");
delay(100);
ClearRXbuffer();
LK.begin();
LK.displayClear();
LK.displaySuspend(false);
LK.displayText(curMessage, scrollAlign, scrollSpeed, scrollPause, scrollEffect, scrollEffect);
// Get the last message from EEPROM
getMessageFromEeprom();
}
void loop()
{
readSerial();
if (LK.displayAnimate())
{
if (newMessageAvailable)
{
strcpy(curMessage, newMessage);
newMessageAvailable = false;
storeMessageInEeprom();
}
LK.displayReset();
}
}
void readSerial(void) {
static char *cp = newMessage;
while (mySerial.available())
{
*cp = (char)mySerial.read();
if ( (*cp == '\r') || (*cp == '\n') || (cp - newMessage >= BUF_SIZE-2)) // end of message character or full buffer
{
*cp = '\0'; // end the string
cp = newMessage;
newMessageAvailable = true;
mySerial.print("Nieuwe Boodschap = ");
mySerial.println(newMessage);
ClearRXbuffer();
}
else // move char pointer to next position
cp++;
}
}
void storeMessageInEeprom(){
// Store the message in EEPROM
EEPROM.write(0,251);
int i=0;
char c=curMessage[i];
while (c !=0){
EEPROM.write(i+1,c);
i++;
c=curMessage[i];
}
EEPROM.write(i+1,0);
}
void getMessageFromEeprom(){
if (EEPROM.read(0)!=251){
strcpy(curMessage, "Hello! Please Send new message over bluetooth");
newMessage[0] = '\0';
} else {
int i=0;
char c = EEPROM.read(i+1);
while (c!=0){
curMessage[i++]=c;
c = EEPROM.read(i+1);
}
curMessage[i] = '\0';
newMessageAvailable=false;
}
}
void ClearRXbuffer(){
while (mySerial.available()){
char c=mySerial.read();
delay(5);
}
}
Si todo está bien (¿y por qué no?), ahora verá el mensaje "Hola, envíe un nuevo mensaje por bluetooth". ¡Así que ya es hora de instalar la aplicación de Android en su teléfono y enviar un nuevo mensaje a través de Bluetooth!
La aplicación de Android:
Para cambiar el texto en el teletipo de noticias, necesitamos un programa de terminal Bluetooth, por ejemplo, el Terminal Bluetooth Serial de Kai Morich, a través del Tienda de aplicaciones.
El funcionamiento de la App es bastante autoexplicativo, pero en el vídeo lo muestro paso a paso.

Atención: el iOS de Apple no se puede conectar al módulo bluetooth usado, por lo que solo funciona con dispositivos Android.