M128/64 STK 1.0.1
 
Loading...
Searching...
No Matches
button Namespace Reference

Functions

void initialize ()
 
uint8_t read (uint8_t pin)
 
uint8_t read ()
 

Detailed Description

The panel has 8 buttons named KEY1 to KEY8. PORTB is connected to the buttons of the panel. Buttons are pushed if the port value is low. PORTB0 - KEY1 PORTB1 - KEY2 PORTB2 - KEY3 PORTB3 - KEY4 PORTB4 - KEY5 PORTB5 - KEY6 PORTB6 - KEY7 PORTB7 - KEY8

Function Documentation

◆ initialize()

void button::initialize ( )

Initializes PORTB to input.

◆ read() [1/2]

uint8_t button::read ( )

Gets the state of all buttons as a number. Highest bit is KEY1, lowest bit is KEY8. Bit value is 1 if the button is pressed, 0 if it is released.

Returns
bitmap of buttons

◆ read() [2/2]

uint8_t button::read ( uint8_t pin)

Gets the state of the button.

Parameters
pinPin of the button
Returns
1 if the button is pressed, 0 if it is released