Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "MicroBit.h"
- MicroBit uBit;
- int main(){
- uBit.init();
- MicroBitImage flower("0,255,30,255,0\n0,30,255,30,0\n,0,255,30,255,0\n,0,0,30,0,0\n0,0,30,0,0\n");
- uBit.display.setDisplayMode(DISPLAY_MODE_GREYSCALE);
- int x=0;
- bool goRight = true;
- while (true){
- uBit.display.image.paste(flower,x,0);
- uBit.sleep(250);
- if (goRight){
- x++;
- if (x > 2){
- goRight = false;
- }
- }
- else if (!goRight){
- x--;
- if (x < -2){
- goRight = true;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement