Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: microbit
main.cpp
- Committer:
- MaxScorda
- Date:
- 2019-06-02
- Revision:
- 2:b767fa1c9241
- Parent:
- 1:ed77b498d5c8
- Child:
- 3:7fb07f1eeffe
File content as of revision 2:b767fa1c9241:
#include "MicroBit.h"
#include "mbed.h"
#include <math.h>       /* sin */
#include <stdlib.h>
#include <string>
//-----------------Init
MicroBit        uBit;
MicroBitImage   map(5,5);
MicroBitDisplay display;
//------------- Vars
int oldx=-1, oldy=-1;
int k = 0, i=0;
int sign=1;
int ccont=0;
int sceltavar=0;
//------------- Personal Libs
#include "Images.h"
#include "Functions.h"
int main()
{
    uBit.init();
    uBit.display.print(map);
    uBit.display.setDisplayMode(DISPLAY_MODE_GREYSCALE);
    uBit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_EVT_ANY, onButton);
    uBit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_EVT_ANY, onButton);
    while (1) {
        if (sceltavar==0)
            FunctionPointFlare();
        else if (sceltavar==1)
            FunctionBounceTest();
        else if (sceltavar==2)
            FunctionImageTest();
        else if (sceltavar==3)
            FunctionPrintTest();
        ccont++;
    }
}