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
 
(8 medziľahlých úprav od rovnakého používateľa nie je zobrazených.)
Riadok 2: Riadok 2:
* http://microbit.org/code/
* http://microbit.org/code/
* Programovanie cez web: https://makecode.microbit.org
* Programovanie cez web: https://makecode.microbit.org


Set of links:
Set of links:
Riadok 27: Riadok 28:


Tuto bude obrazok v blocks a pod nim tri rozlicne stlpecky, ani nemusia byt collapsible:
Tuto bude obrazok v blocks a pod nim tri rozlicne stlpecky, ani nemusia byt collapsible:
[[Súbor:microbit01.png]]


{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
|-
|- style="vertical-align:top;"
| style="background: #ffffcc" |
| style="background: LightYellow" |
'''Javascript'''
<source lang="javascript">
<source lang="javascript">


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


Riadok 39: Riadok 42:


|  
|  
<source lang="python">
'''Python'''
<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>


|  
|  
<source lang="c">
'''C++'''
#include "MicroBit.h"
<syntaxhighlight lang=c style="background: Cornsilk">
#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();
}
}
</source>
</syntaxhighlight>


|}
|}
[[Súbor:microbit01Run.png|thumb|372px|center|Výsledok bude vyzerať takto...]]
Manuál k  Blocks  https://makecode.microbit.org/blocks
Manuál k Javascriptu: https://makecode.microbit.org/javascript
Manuál k Pythonu: https://microbit-micropython.readthedocs.io/en/latest/
Manuál k C-čku: https://lancaster-university.github.io/microbit-docs/
Jazyk (asi je najlepsie pouzit anglictinu, ale keby niekto trval na slovencine pre Blocks, tak takto:  https://makecode.microbit.org/?lang=sk_SK


<div class="toccolours mw-collapsible mw-collapsed">'''Python'''
<div class="toccolours mw-collapsible mw-collapsed">'''Python'''
Riadok 84: Riadok 104:
</div>
</div>


<div class="toccolours mw-collapsible mw-collapsed">'''Python'''
Naprogramujte program pre
<div class="mw-collapsible-content">
<source lang="c">
#include "MicroBit.h"


MicroBit uBit;


int main()
Dalsie linky z r. 2020:
{
    // Initialise the micro:bit runtime.
    uBit.init();


    // Insert your code here!
* Conference https://www.accelevents.com/e/microbitLIVE/portal/schedule/93605
    uBit.display.scroll("Ahoj :)");
* https://makecode.com/multi#


    // If main exits, there may still be other fibers running or registered event handlers etc.
* https://makecode.microbit.org/projects/radio-games
    // Simply release this fiber, which will mean we enter the scheduler. Worse case, we then
* https://makecode.microbit.org/--docs#book:/courses/ucp-science/SUMMARY
    // sit in the idle task forever, in a power efficient sleep.
* https://magazines.micromag.cc/
    release_fiber();
* https://github.com/edgeimpulse/voice-activated-microbit
}
* https://www.youtube.com/watch?v=qfj5GpmZedI&t=3s
</source>
* https://docs.google.com/presentation/d/12MgmslCaE2100l4KhulzObzF1P8tDrHwijcYNqVApj4/edit#slide=id.p1
 
</div>
</div>




[[Category: Základy počítačov]] [[Category: micro:bit]]
[[Category: Základy počítačov]] [[Category: micro:bit]]

Aktuálna revízia z 22:38, 5. december 2020

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();
}


Výsledok bude vyzerať takto...

Manuál k Blocks https://makecode.microbit.org/blocks

Manuál k Javascriptu: https://makecode.microbit.org/javascript

Manuál k Pythonu: https://microbit-micropython.readthedocs.io/en/latest/

Manuál k C-čku: https://lancaster-university.github.io/microbit-docs/

Jazyk (asi je najlepsie pouzit anglictinu, ale keby niekto trval na slovencine pre Blocks, tak takto: https://makecode.microbit.org/?lang=sk_SK


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)


Dalsie linky z r. 2020: