Saludos
Si alguien puede ayudarme porfavor
Usando
Arduino uno R3
Modulo Bluetooth HC-06 para Arduino
Teclado numérico 4x3
Estoy tratando de que con un teclado númerico luego de teclear 4 numeros cualquiera, lo envie al bluetooth.
Y muy importante que no necesite del monitor serial para teclear, que sea independiente para trabajar con alimentacion directa y no por via usb. Gracias de antemano por la ayuda que puedan prestarme.
Aqui les dejo el Sketch, el teclado trabaja bien y da una linea nueva cada 6 segundos, eso esta muy bien, pero no logro que escriba sin monitor serial y que esa misma info la envie por bluetooth.
#include <Keypad.h>
#include <SoftwareSerial.h> // importa la libreria serial
SoftwareSerial myConnection(10, 11); // RX, TX
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
unsigned long loopCount = 0;
unsigned long timer_t = 0;
void setup(){
Serial.begin(9600);{
myConnection.begin(9600);
}
// Try playing with different debounceTime settings to see how it affects
// the number of times per second your loop will run. The library prevents
// setting it to anything below 1 millisecond.
kpd.setDebounceTime(10); // setDebounceTime(mS)
}
void loop(){
char key = kpd.getKey();
// Report the number of times through the loop in 1 second. This will give
// you a relative idea of just how much the debounceTime has changed the
// speed of your code. If you set a high debounceTime your loopCount will
// look good but your keypresses will start to feel sluggish.
if ((millis() - timer_t) > 6000) {
Serial.print("bebe ");
//Serial.print(loopCount);
Serial.println(" bebe1");
//loopCount = 0;
timer_t = millis();{
myConnection.print("Test transmission String.");
delay(1000);
}
}
loopCount++;
if(key)
Serial.print(key);
}