Hallo habe mich heute wider tatkräftig beschäftigt :
Stehe aber ein wenig an ;D
hc
Ich habe wie unten im Code die Buchstaben definiert (also welcher Pin von denn 4* 74hc595 (Datenblatt) wen Eingestellt werden müssen). Diese habe ich in const bool Array gespeichert. Wiso? weil ich den code besser verstehe 
Jetzt lese ich die Zeit von dem Uhrenmodul (Tiny RTC I2C AT24C32 DS1307)
Jetzt habe ich die Funktion TimeToWord gemacht, und wollte eigentlich der Variabel Muster übergeben. Geht aber nicht.

Das spräche sehr für (bzw. geht nur mit) die unsigned long Variante.
Also das Problem das ich in diesem Post bearbeiten will ist, wen die Uhrzeit hour =1 dann Muster = EINS
ect.....
void TimeToWord ()
{
ASK_TIME ();
if(hour == 1 && minute == 0)
{ Muster = EIN; //=> hier Reklamiert das Programm
}
}
#include "Wire.h" //Für das Uhren Modul -> I2C Komunikation (A5 und A4)
#define DS1307_ADDRESS 0x68 //Adesse des Uhr Modul
//Lyberys//
//------------------------------------------------------------------------------------------------------------------------------------------//
// Arduino-Pin verbunden mit SH_CP des 74HC595
int shiftPin = 0;
// Arduino-Pin verbunden mit ST_CP des 74HC595
int storePin = 1;
// Arduino-Pin verbunden mit DS des 74HC595
int dataPin = 3;
int second;
int minute;
int hour;
int weekDay;
int monthDay;
int month;
int year;
//Pinout//
//------------------------------------------------------------------------------------------------------------------------------------------//
//___________________________________________Anode zuerst anschliessen_____________Katode
//_____________________________________________ - +
//------------------------------- 1 -2 -3 -4 -5 -6 -7 -8 -9 -0 -1-----2 -3 -4 -5 -6----7 -8 -9 -0 -1 -2 -3 -4 -5 -6----7 -8 -9 -0 -1 -2
const bool ES_IST [32] = {1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool VOR [32] = {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool NACH [32] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool UHR [32] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0};
const bool FUENFMIN [32] = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool ZEHNMIN [32] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool VIERTEL [32] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool ZWANZIG [32] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool HALB [32] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool DREIVIERTEL [32] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool EIN [32] = {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool EINS [32] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool ZWEI [32] = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool DREI [32] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool VIER [32] = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool FUENFSTUND [32] = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool SECHS [32] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0};
const bool SIEBEN [32] = {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0};
const bool ACHT [32] = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0};
const bool NEUN [32] = {0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0};
const bool ELF [32] = {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const bool ZWOELF [32] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0};
const bool ZEHNSTUND [32] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0};
//Definitionen der Buchstaben//
//------------------------------------------------------------------------------------------------------------------------------------------//
void setup() {
Wire.begin();
// Pins 0,1,3 auf Ausgabe
pinMode(storePin, OUTPUT);
pinMode(shiftPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
//Setup//
//------------------------------------------------------------------------------------------------------------------------------------------//
byte bcdToDec(byte val) {
// Convert binary coded decimal to normal decimal numbers
return ( (val / 16 * 10) + (val % 16) );
}
//__________________________________________________________________________________________________________________________________________//
void ASK_TIME() {
// Reset the register pointer
Wire.beginTransmission(DS1307_ADDRESS);
byte zero = 0x00;
Wire.write(zero);
Wire.endTransmission();
Wire.requestFrom(DS1307_ADDRESS, 7);
second = bcdToDec(Wire.read());
minute = bcdToDec(Wire.read());
hour = bcdToDec(Wire.read() & 0b111111); //24 hour time
weekDay = bcdToDec(Wire.read()); //0-6 -> sunday - Saturday
monthDay = bcdToDec(Wire.read());
month = bcdToDec(Wire.read());
year = bcdToDec(Wire.read());
}
//Zeit Funktionen//
//------------------------------------------------------------------------------------------------------------------------------------------//
void TimeToWord ()
{
ASK_TIME ();
if(hour == 1 && minute == 0)
{ Muster = EIN;
}
}
//------------------------------------------------------------------------------------------------------------------------------------------//
void ANZEIGE (bool Muster[])
{
digitalWrite(storePin, LOW);
for (int i = 0; i < 32; i++) {
digitalWrite(shiftPin, LOW); // Aktion passiert bei Wechsel von LOW auf HIGH drum jetzt zuerst LOW schalten
digitalWrite(dataPin, Muster[i]); // Jetzt den Wert der aktuellen Stelle ans Datenpin DS anlegen
digitalWrite(shiftPin, HIGH); // Dann ShiftPin SHCP von LOW auf HIGH, damit wird der Wert am Datenpin ins Register geschoben.
}
digitalWrite(storePin, HIGH); // Wenn alle 32 Stellen im Register sind, jetzt das StorePin STCP von LOW auf HIGH, damit wird Registerinhalt
//an Ausgabepins kopiert und der Zustand an den LEDs sichtbar
}
//Anzeigen Funktion//
//------------------------------------------------------------------------------------------------------------------------------------------//
und die Fehler Meldung
Firmware-Selbst:104: error: 'Muster' was not declared in this scope
{ Muster = EIN;
^
exit status 1
'Muster' was not declared in this scope
Wie mus ich Muster definieren (also auserhalb der Funktion ist mir schon klar
) das es so funktionieren kann?
Und wie würdet Ihr das machen?
unsigned long Muster = 0b010110100101101001100110... Noch fast nie gebraucht und noch weniger verstanden :o
Gruess und Vielen Dank an alle die sich die Zeit nehmen das zu lesen.
Benjamin