Adafruit micro:bit Library
Public Member Functions | Static Public Attributes | List of all members
Adafruit_Microbit_Matrix Class Reference

#include <Adafruit_Microbit.h>

Inheritance diagram for Adafruit_Microbit_Matrix:

Public Member Functions

boolean begin (void)
 Initialized the 5x5 matrix and scanning IRQ. More...
 
void drawPixel (int16_t x, int16_t y, uint16_t color)
 Draw a single pixel/LED on the 5x5 matrix. More...
 
void fillScreen (uint16_t color)
 Fill the 5x5 matrix with an LED 'color'. More...
 
void clear (void)
 Clear the 5x5 matrix.
 
void rowHandler (void)
 Matrix object function called by IRQ handler for each row This is not optimized at all but its not so bad either!
 
void show (const uint8_t bitmap[])
 Display a 5-byte bitmap on the 5x5 LED matrix. More...
 
void scrollText (char *string, uint8_t stepdelay=150)
 Scroll display a string on the 5x5 LED matrix. More...
 
void print (char *string)
 Display a string on the 5x5 LED matrix. More...
 
void print (int32_t i)
 Display a signed number on the 5x5 LED matrix. More...
 
void print (int i)
 Display a signed number on the 5x5 LED matrix. More...
 
void print (double f, int precision=3)
 Display a floating point number on the 5x5 LED matrix. More...
 

Static Public Attributes

static const uint8_t EMPTYHEART [5]
 an empty heart icon More...
 
static const uint8_t HEART [5]
 full heart icon More...
 
static const uint8_t NO [5]
 X icon. More...
 
static const uint8_t YES [5]
 Check icon. More...
 
static const uint8_t MICROBIT_SMILE [5]
 smile icon More...
 

Detailed Description

Class to create Adafruit_GFX interface for 5x5 matrix of micro:bit

Member Function Documentation

◆ begin()

boolean Adafruit_Microbit_Matrix::begin ( void  )

Initialized the 5x5 matrix and scanning IRQ.

Returns
True

◆ drawPixel()

void Adafruit_Microbit_Matrix::drawPixel ( int16_t  x,
int16_t  y,
uint16_t  color 
)

Draw a single pixel/LED on the 5x5 matrix.

Parameters
x0 to 4 column
y0 to 4 row
color1 for LEDs on, 0 for off

◆ fillScreen()

void Adafruit_Microbit_Matrix::fillScreen ( uint16_t  color)

Fill the 5x5 matrix with an LED 'color'.

Parameters
color1 for LEDs on, 0 for off

◆ show()

void Adafruit_Microbit_Matrix::show ( const uint8_t  bitmap[])

Display a 5-byte bitmap on the 5x5 LED matrix.

Parameters
bitmap5 byte bitmap

◆ scrollText()

void Adafruit_Microbit_Matrix::scrollText ( char *  string,
uint8_t  stepdelay = 150 
)

Scroll display a string on the 5x5 LED matrix.

Parameters
stringNull-terminated ascii string
stepdelayMilliseconds per scroll step

◆ print() [1/4]

void Adafruit_Microbit_Matrix::print ( char *  string)

Display a string on the 5x5 LED matrix.

Parameters
stringNull-terminated ascii string

◆ print() [2/4]

void Adafruit_Microbit_Matrix::print ( int32_t  i)

Display a signed number on the 5x5 LED matrix.

Parameters
iThe value

◆ print() [3/4]

void Adafruit_Microbit_Matrix::print ( int  i)

Display a signed number on the 5x5 LED matrix.

Parameters
iThe value

◆ print() [4/4]

void Adafruit_Microbit_Matrix::print ( double  f,
int  precision = 3 
)

Display a floating point number on the 5x5 LED matrix.

Parameters
fThe floating point value
precisionDigits after decimal

Member Data Documentation

◆ EMPTYHEART

const uint8_t Adafruit_Microbit_Matrix::EMPTYHEART
static
Initial value:
= {
B01010, B10101, B10001, B01010, B00100,
}

an empty heart icon

◆ HEART

const uint8_t Adafruit_Microbit_Matrix::HEART
static
Initial value:
= {
B01010, B11111, B11111, B01110, B00100,
}

full heart icon

◆ NO

const uint8_t Adafruit_Microbit_Matrix::NO
static
Initial value:
= {
B10001, B01010, B00100, B01010, B10001,
}

X icon.

◆ YES

const uint8_t Adafruit_Microbit_Matrix::YES
static
Initial value:
= {
B00000, B00001, B00010, B10100, B01000,
}

Check icon.

◆ MICROBIT_SMILE

const uint8_t Adafruit_Microbit_Matrix::MICROBIT_SMILE
static
Initial value:
= {
B00000, B01010, B00000, B10001, B01110,
}

smile icon

Preset smile image for LED matrix.


The documentation for this class was generated from the following files: