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.
main.cpp
- Committer:
- DieOma
- Date:
- 2017-08-22
- Revision:
- 0:54e78c24b373
File content as of revision 0:54e78c24b373:
#include "MicroBit.h"
#include "mbed.h"
#include <math.h> /* sin */
//A little Animation for using GREY_SCALE_MODE
MicroBit uBit;
MicroBitImage map(5,5);
int main() {
uBit.init();
uBit.display.print(map);
uBit.display.setDisplayMode(DISPLAY_MODE_GREYSCALE);
int value = 250;
int k = 0;
while (1) {
for(int i = 0; i<5;i++){
for(int j = 0; j < 5; j++){
value = (125 *(1 + sin((i+k) * PI / 10)));
uBit.display.image.setPixelValue(i,j, value); }
};
k++;
uBit.sleep(100);
};
}