Grundkenntnisse Programmierung 5 (Tür Sicherheitssystem): Unterschied zwischen den Versionen

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 9: Zeile 9:
Anfang:
Anfang:


goto Anfang; // Springt zu dem Label.
goto Anfang; // Springt zu dem Anfang
</syntaxhighlight>
 
==<code>Keypad(makeKeymap(userKeymap), row[], col[], rows, cols)</code>==
Keypad is a library for using matrix style keypads with the Arduino.<br>
 
'''Quelltext 1:''' <code>goto.ino</code>
<syntaxhighlight lang="C" style="border: none; background-color: #EFF1C1; font-size:14px">
const byte rows = 4; //vier Reihen
const byte cols = 3; //drei Spalten
char keys[rows][cols] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'#','0','*'}
};
byte rowPins[rows] = {5, 4, 3, 2}; // Verbindet die Reihen Pinouts des Keypads
byte colPins[cols] = {8, 7, 6}; //Verbindet die Spalten Pinouts des Keypads
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, rows, cols);
</syntaxhighlight>
</syntaxhighlight>




→ zurück zum Hauptartikel: [[Arduino Projekt: Tür Sicherheitssystem| Klicken!]]
→ zurück zum Hauptartikel: [[Arduino Projekt: Tür Sicherheitssystem| Klicken!]]

Version vom 25. Juli 2023, 16:24 Uhr

Autor: Justin Frommberger

goto

Springt im Programmfluss zu einem bestimmten, benannten Punkt.

Quelltext 1: goto.ino

Anfang:

goto Anfang; // Springt zu dem Anfang

Keypad(makeKeymap(userKeymap), row[], col[], rows, cols)

Keypad is a library for using matrix style keypads with the Arduino.

Quelltext 1: goto.ino

const byte rows = 4; //vier Reihen
const byte cols = 3; //drei Spalten
char keys[rows][cols] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'#','0','*'}
};
byte rowPins[rows] = {5, 4, 3, 2}; // Verbindet die Reihen Pinouts des Keypads
byte colPins[cols] = {8, 7, 6}; //Verbindet die Spalten Pinouts des Keypads
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, rows, cols);


→ zurück zum Hauptartikel: Klicken!