Grundkenntnisse Programmierung 6 (Arduino Pong Spiel)

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen

const

  • Das const-Keywort steht für Konstanten.
  • Das bedeutet, dass die Variable wie alle anderen Variablen des gleichen Typs benutzt werden kann, aber dass der Wert unveränderlich ist.

#define oder const

  • Für Konstanten kann entwerder const oder #define verwendet werden.
  • Für Arrays muss const verwendet werden.

unsigned long

  • Kann keine negativen Zahlen speichern.
  • Bereich liegt zwischen 0 und 4,294,967,295 (2^32 - 1)

uint8_t

UINT8_t == unsigned char U -> unsigned ohne Vorzeichen INT -> Integer 8 -> Bit länge _t -> Kennung das ein Typ ist

OLED Display

display.clearDisplay() = all pixels are off
display.drawPixel(x,y, color) – plot a pixel in the x,y coordinates
display.setTextSize(n) = set the font size, supports sizes from 1 to 8
display.setCursor(x,y) = set the coordinates to start writing text
display.print(“message”) = print the characters at location x,y
display.display() = call this method for the changes to make effect