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

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Zeile 13: Zeile 13:


==<code>Keypad(makeKeymap(userKeymap), row[], col[], rows, cols)</code>==
==<code>Keypad(makeKeymap(userKeymap), row[], col[], rows, cols)</code>==
Keypad is a library for using matrix style keypads with the Arduino.<br>
Keypad ist eine Bibliothek, um Matrix Style Keypads mit dem Arduino nutzen zu können.<br>  
 
'''Quelltext 1: ''' <code>goto.ino</code>
'''Quelltext 1:''' <code>goto.ino</code>
<syntaxhighlight lang="C" style="border: none; background-color: #EFF1C1; font-size:14px">
<syntaxhighlight lang="C" style="border: none; background-color: #EFF1C1; font-size:14px">
const byte rows = 4; //vier Reihen
const byte rows = 4; //vier Reihen

Version vom 25. Juli 2023, 14:26 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 ist eine Bibliothek, um Matrix Style Keypads mit dem Arduino nutzen zu können.
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!