Operácie

Micro:bit: Rozdiel medzi revíziami

Zo stránky SensorWiki

Balogh (diskusia | príspevky)
Bez shrnutí editace
Balogh (diskusia | príspevky)
Bez shrnutí editace
Riadok 30: Riadok 30:
{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
|- style="vertical-align:top;"
|- style="vertical-align:top;"
| style="background: #ffffcc" |
| style="background: LightYellow" |
'''Javascript'''
'''Javascript'''
<source lang="javascript">
<source lang="javascript">


basic.showString("Hello!")
basic.showIcon(IconNames.Heart)
basic.showIcon(IconNames.Heart)


Riadok 41: Riadok 40:
|  
|  
'''Python'''
'''Python'''
<source lang="python" style="background: red;">
<source lang="python" style="background: LightBlue;">


from microbit import *
from microbit import *


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


|  
|  
'''C++'''
'''C++'''
<syntaxhighlight lang=c style="background: #ffffcc">
<syntaxhighlight lang=c style="background: Cornsilk">
#include "MicroBit.h"
#include "MicroBit.h"



Verzia z 23:40, 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;

int main()
{
    uBit.init();

    uBit.display.scroll("Ahoj :)");

    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)