Operácie

Micro:bit krúžok: Rozdiel medzi revíziami

Z SensorWiki

(Návody)
(WebUSB)
(5 medziľahlých úprav od rovnakého používateľa nie je zobrazených.)
Riadok 1: Riadok 1:
== Návody ==
+
== Harmonogram ==
 +
 
 +
Hlasujte kedy chcete chodievat: https://doodle.com/poll/dns5sfptrh96q86w
 +
 
 +
 
 +
 
 +
== '''Návody''' ==
  
 
[[Image:SparkfunExpansionConnector.jpeg|left|100px]]
 
[[Image:SparkfunExpansionConnector.jpeg|left|100px]]
Riadok 44: Riadok 50:
 
* [https://microbit-playground.co.uk/components/ultrasound-distance-sensor] sonar package
 
* [https://microbit-playground.co.uk/components/ultrasound-distance-sensor] sonar package
  
== '''7. marca 2018''' ==
+
 
 +
 
 +
 
 +
== '''Programovanie''' ==
 +
 
 +
# Blockly - [https://makecode.microbit.org/ skok do editora] / [https://makecode.microbit.org/reference príručka] / [https://microbit.org/en/2017-03-07-javascript-block-resources/ projekty]
 +
# Javascript - [https://makecode.microbit.org/ skok do editora] (ten istý)
 +
# Python - [https://python.microbit.org/ skok do editora] / [https://microbit.org/guide/python/ príručka]
 +
# C, C++ - [https://learn.adafruit.com/use-micro-bit-with-arduino/overview Arduino]
 +
# C, C++ - [https://os.mbed.com/platforms/Microbit/ mbed C++]
 +
# C, C++ - [https://www.instructables.com/id/BBC-Microbit-C-Getting-Started/ offline version] (Netbeans)
 +
# ostatné [https://microbit.org/code-alternative-editors/ Scratch, Kodu, Matlab,...]
 +
 
 +
 
 +
== '''WebUSB''' ==
 +
 
 +
WebUSB je nová funkcionalita, ktorá umožňuje mať priamo pripojený microbit k webovej aplikácii. Rovnako funguje
 +
aj Win10 aplikácia, kedy sa priamo programuje a komunikuje.
 +
 
 +
# Google Chrome v 65+ (other browsers do not yet have Web USB support)
 +
# Update firmware https://microbit.org/guide/firmware/
 +
## Pripoj microbit so stlacenym RESET tlacitkom - objavi sa ako disk MAINTENANCE (nie ako obvykle microbit)
 +
## Nakopiruj novy firmware
 +
## Skontroluj DETAILS.TXT na microbite
 +
# Hotovo. The settings menu in MakeCode should contain an additional menu item entitled Pair Device
 +
 
 +
Zdroj: https://support.microbit.org/support/solutions/articles/19000084059-beta-testing-web-usb
 +
 
 +
== '''Správy''' ==
 +
 
 +
 
 +
=== 7. 3. 2018 ===
  
 
Vymeniť CMOS baterky v PC aby si pamätal čas.
 
Vymeniť CMOS baterky v PC aby si pamätal čas.

Verzia zo dňa a času 06:33, 24. máj 2019

Harmonogram

Hlasujte kedy chcete chodievat: https://doodle.com/poll/dns5sfptrh96q86w


Návody

SparkfunExpansionConnector.jpeg



SparkfunMBIK.jpeg




SparkfunWeather.jpeg

SparkFun micro:climate kit



SparkfunMicroBot.jpeg


KitronikMoveRobot.jpeg


MicroBitEdgeConnector.png
SensorHC-SR-04.jpeg
  • Ultrazvukový senzor
  • [1] Zapojenie, je potrebné napájanie?
  • pulse-in príkaz
  • [2] sonar package



Programovanie

  1. Blockly - skok do editora / príručka / projekty
  2. Javascript - skok do editora (ten istý)
  3. Python - skok do editora / príručka
  4. C, C++ - Arduino
  5. C, C++ - mbed C++
  6. C, C++ - offline version (Netbeans)
  7. ostatné Scratch, Kodu, Matlab,...


WebUSB

WebUSB je nová funkcionalita, ktorá umožňuje mať priamo pripojený microbit k webovej aplikácii. Rovnako funguje aj Win10 aplikácia, kedy sa priamo programuje a komunikuje.

  1. Google Chrome v 65+ (other browsers do not yet have Web USB support)
  2. Update firmware https://microbit.org/guide/firmware/
    1. Pripoj microbit so stlacenym RESET tlacitkom - objavi sa ako disk MAINTENANCE (nie ako obvykle microbit)
    2. Nakopiruj novy firmware
    3. Skontroluj DETAILS.TXT na microbite
  3. Hotovo. The settings menu in MakeCode should contain an additional menu item entitled Pair Device

Zdroj: https://support.microbit.org/support/solutions/articles/19000084059-beta-testing-web-usb

Správy

7. 3. 2018

Vymeniť CMOS baterky v PC aby si pamätal čas.

Skupina 15:00 chodili robotom po čiare, potrebujeme vyriešiť analógový vstup senzorov.

Skupina 12:30 robili sme diaľkové ovládanie robota druhým microbitom. A+B - rovno, A - doprava, B - doľava inak stop. Fungovalo.


radio.setGroup(1)
basic.forever(() => {
    if (input.buttonIsPressed(Button.AB)) {
        radio.sendString("FORWARD")
        basic.showLeds(`
            . . # . .
            . # # # .
            # . # . #
            . . # . .
            . . # . .
            `)
    } else if (input.buttonIsPressed(Button.B)) {
        radio.sendString("LEFT")
        basic.showLeds(`
            . . # . .
            . # . . .
            # # # # #
            . # . . .
            . . # . .
            `)
    } else if (input.buttonIsPressed(Button.A)) {
        radio.sendString("RIGHT")
        basic.showLeds(`
            . . # . .
            . . . # .
            . # # # #
            . . . # .
            . . # . .
            `)
    } else {
        radio.sendString("OFF")
        basic.showLeds(`
            . # # # .
            # # . # #
            # . # . #
            # # . # #
            . # # # .
            `)
    }
})
input.onButtonPressed(Button.A, () => {
    motobit.setMotorSpeed(Motor.Right, MotorDirection.Forward, 100)
    basic.showLeds(`
        . . . . .
        . . # . .
        . . # . .
        . . . . .
        . . . . .
        `)
})
input.onButtonPressed(Button.B, () => {
    motobit.enable(MotorPower.On)
    basic.showLeds(`
        # . . . .
        . # . . .
        . . # . .
        . . . # .
        . . . . #
        `)
})
function ON()  {
    motobit.enable(MotorPower.On)
}
function OFF()  {
    motobit.enable(MotorPower.Off)
}
function 前進()  {
    motobit.setMotorSpeed(Motor.Right, MotorDirection.Forward, 30)
    motobit.setMotorSpeed(Motor.Left, MotorDirection.Forward, 30)
}
radio.onDataPacketReceived( ({ receivedString }) =>  {
    if (receivedString == "ON") {
        ON()
    } else if (receivedString == "OFF") {
        OFF()
    } else if (receivedString == "FORWARD") {
        前進()
    } else if (receivedString == "BACK") {
        後進()
    } else if (receivedString == "RIGHT") {
        右折()
    } else if (receivedString == "LEFT") {
        左折()
    } else {
        OFF()
    }
})
function 左折()  {
    motobit.setMotorSpeed(Motor.Right, MotorDirection.Forward, 30)
    motobit.setMotorSpeed(Motor.Left, MotorDirection.Reverse, 30)
}
function 右折()  {
    motobit.setMotorSpeed(Motor.Right, MotorDirection.Reverse, 30)
    motobit.setMotorSpeed(Motor.Left, MotorDirection.Forward, 30)
}
function 後進()  {
    motobit.setMotorSpeed(Motor.Right, MotorDirection.Reverse, 30)
    motobit.setMotorSpeed(Motor.Left, MotorDirection.Reverse, 30)
}
radio.setGroup(1)
basic.showLeds(`
    . . # . .
    . . . . .
    # # # # #
    . . . . .
    . . # . .
    `)