Operácie

Micro:bit: Rozdiel medzi revíziami

Z SensorWiki

Riadok 51: Riadok 51:
 
'''C++'''
 
'''C++'''
 
<syntaxhighlight lang=c style="background: Cornsilk">
 
<syntaxhighlight lang=c style="background: Cornsilk">
#include "MicroBit.h"
+
#include "MicroBit.h"
  
MicroBit uBit;
+
MicroBit uBit;
 +
MicroBitImage heart("0,1,0,1,0\n
 +
                      1,0,1,0,1\n
 +
                      0,1,0,1,0\n
 +
                      1,0,1,0,1\n
 +
                      0,1,0,1,0\n"); // 5x5 image
  
 
int main()
 
int main()
 
{
 
{
 
     uBit.init();
 
     uBit.init();
 
+
     uBit.display.print(image);
     uBit.display.scroll("Ahoj :)");
 
 
 
 
     release_fiber();
 
     release_fiber();
 
}
 
}

Verzia zo dňa a času 23:50, 15. január 2018

Hlavná stránka:

Set of links:



Deep into details:


Skusime urobit prvy program v rozlicnych jazykoch:

Tuto bude obrazok v blocks a pod nim tri rozlicne stlpecky, ani nemusia byt collapsible:

Javascript

basic.showIcon(IconNames.Heart)

Python

from microbit import *

display.show(Image.HEART)

C++

 #include "MicroBit.h"

 MicroBit uBit;
 MicroBitImage heart("0,1,0,1,0\n
                      1,0,1,0,1\n
                      0,1,0,1,0\n
                      1,0,1,0,1\n
                      0,1,0,1,0\n"); // 5x5 image 

int main()
{
    uBit.init();
    uBit.display.print(image);
    release_fiber();
}
Python

Naprogramujte program pre

# Add your Python code here. E.g.
from microbit import *


while True:
    display.scroll('Hello, World!')
    display.show(Image.HEART)
    sleep(2000)