Inventor's kit experiment one: say "hello" to the bbc miicro:bit

Dependencies:   microbit

main.cpp

Committer:
haraldblab
Date:
2020-05-10
Revision:
0:9d5e4cc4a281

File content as of revision 0:9d5e4cc4a281:

/* 
 * Inventor's kit for micor:bit
 * Experiment 1: Say "Hello"to the BBC micro:bit
*/
#include "MicroBit.h"

MicroBit    uBit;
MicroBitImage smiley("0,255,0,255, 0\n0,255,0,255,0\n0,0,0,0,0\n255,0,0,0,255\n0,255,255,255,0\n");

int main()
{
    // Initialize the micor:bit
    uBit.init();
    
    // loop
    while(1)
    {
        if (uBit.buttonA.isPressed())
            uBit.display.print(smiley);
        
        if (uBit.buttonB.isPressed())
            uBit.display.scroll("Hello world");

    }
}