Hallo,
da ich mich schon länger damit beschäftige mir einen AquaController mit nen Arduino zu bauen, steh ich nach anfänglichen Schwierigkeiten des Sketches vor dem Problem, dass er das 4x4 Keypad bei Tastendruck einfach ignoriert.
In dem Sketch ist ein Menu enthalten, dieses über 5 Taster zu steuern sein soll.
Sowas wie
UP 2
DOWN 8
RIGHT 6
LEFT 4
SELECT 5
Außerdem gibt das Programm nichts im Serial Monitor aus trotz den serial.println Befehlen.
Hier mal der Sketch:
//#include <math.h>
#include <LiquidCrystal_I2C.h>
//#include <LiquidCrystal.h>
#include <Wire.h>
#include <DS1307.h>
#include <EEPROMex.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <AFMotor.h>
#include <Keypad.h>
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ H A R D W A R E +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
//Initialisierung
#define ONE_WIRE_BUS 2 // Data wire is plugged into port 8 on the Arduino
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
// arrays to hold device address
DeviceAddress wasserThermometer, raumThermometer;
//DS1307 rtc(16, 17); //Uno
DS1307 rtc(56, 57); //Mega
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 20 chars and 4 line display, Backlight PWM PIN 10
//LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
// Erstellung eines Fish-Symbols das nach rechts schaut
byte newChar[8] = {
B00000,
B00000,
B10001,
B11011,
B11111,
B11111,
B11001,
B10000
};
byte newChar1[8] = {
B00001,
B00010,
B11101,
B11010,
B11111,
B11110,
B11100,
B00000
};
// Erstellung eines Fish-Symbols das nach links schaut
byte newChar2[8] = {
B00000,
B00000,
B10001,
B11011,
B11111,
B11111,
B10011,
B00001
};
byte newChar3[8] = {
B10000,
B01000,
B10111,
B01011,
B11111,
B01111,
B00111,
B00000
};
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ K O N S T A N T E N +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
const int DISPLAY_LETZTE_SEITE = 6;
const int DISPLAY_WARTEZEIT = 4;
const long HOUR = 60 * 60;
const long MINUTE = 60;
const int MAXPWMSTEPS = 4096;
const byte rows = 4;
const byte cols = 4;
char keys[rows][cols] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[rows] = {22,23,24,25};
byte colPins[cols] = {26,27,28,29};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, rows, cols);
//Hier werden die Tasten des Keyboards festgelegt und müssen je nach Keypad angepasst werden
#define RIGHTKEY 6
#define UPKEY 2
#define DOWNKEY 8
#define LEFTKEY 4
#define SELECTKEY 5
Im Anhang befindet sich der komplette Sketch.
Hat jemand eine Idee warum er auf keine Tasten reagiert?
display.ino (4.3 KB)
Dosierpumpe_20131104_V1_4.ino (33.8 KB)
functions.ino (22.4 KB)
menuWerte.ino (15 KB)
menuWerteAuswahl.ino (21.8 KB)
menuWerteSetzen.ino (38.9 KB)

