PROGRAMMING SCHOOL
Programming micro:bit in MakeCode
1. ULTRASOUND SENSOR (3.3V) - random car control11. LIGHT CONTROLL - POTO sensor (ANALOGUE) - RECOGNIZING BLACK LINE
2. ENCODER MOTOR - COUNTER CONTROL12. LIGHT CONNTROL - POTO sensor (ANALOGUE)
3. 4 x DC motor control - anlogue - digitaly13. LIGHT CONTROLL - MAGNETIC sensor (DIGITALLY) 4
4. 2 x DC motor control - anlogue14. LIGHT CONTROLL - POTO sensor (DIGITALLY) 3
5. ULTRASONIC SENSOR DISTANCE MEASUREMENT - value display15. LIGHT CONTROLL - POTO sensor (DIGITALLY) 2
6. ULTRASONIC SENSOR DISTANCE MEASUREMENT - View as GRAPH16. LIGHT CONTROLL - PUSH BUTTON (DIGITALLY)
7. Controling LEDs with Potentiometer17. TWO LIGHTS CONTROLL WITH BUTTONS A AND B
8. SERVO MOTOR18. TWO LIGHTS CONTROLL
9. MOTOR - ROTATION CONTROL WITH BUTTONS "A" AND "B"19. LIGHT / LED CONTROLL
10. COLOR SENZOR (FischerTechnik) - COLOR recognition

ULTRASOUND SENSOR (3.3V) - random car controlTOP
spajanje20_mb.jpg

Connect the ULTRASONIC sensor to the 3.3V supply (red and green). Connect the signal wires to the input P0 (blue) and P3 (black). Connect the right motor to the motor outputs M1 (P15 and P16), and the left at the motor outputs M2 (P13 and P14). ADD package "SONAR".

ENCODER MOTOR - COUNTER CONTROLTOP
spajanje19_mb.jpg

Connect encoder motor to OUTPUTS P15 and P16. Counter supply ( green and red wire ) connect to 5V output. Signal wire connect to INPUT P1.

4 x DC motor control - anlogue - digitalyTOP
spajanje17_mb.jpg

Speed control of four DC motors. Simulation of analog control via the "write digital" command. MakeCode has a limit of max. three outputs that can control analog. This is a method that works similar to the PWM control (write analog).

2 x DC motor control - anlogueTOP
spajanje16_mb.jpg

DC motor speed control via write analog command. The limit is a maximum of three DC motors.

ULTRASONIC SENSOR DISTANCE MEASUREMENT - value displayTOP
spajanje15_mb.jpg

Measuring distance by ultrasonic sensor with results display in the form of values, on the micro: bit screen. You need package "SONAR".

ULTRASONIC SENSOR DISTANCE MEASUREMENT - View as GRAPHTOP
spajanje14_mb.jpg

Ultrasound sensor distance measurement with bar graph display on micro:bits screen. You need package "SONAR".

Controling LEDs with PotentiometerTOP
spajanje13_mb.jpg

Turning the potentiometer turns on the LEDs. The potentiometer is connected to INPUT P0 and reads analogously. The interface is powered by a universal 5V adapter.

SERVO MOTORTOP
spajanje12_mb.jpg

Connect servo (4.8 - 6V) to 5V supply and signal wire to INPUT P0.

MOTOR - ROTATION CONTROL WITH BUTTONS "A" AND "B"TOP
spajanje11_mb.jpg

Connect motor on OUTPUTS 1 i 2 (P16 i P15).

COLOR SENZOR (FischerTechnik) - COLOR recognitionTOP
spajanje10_mb.jpg

Connect the RED light to OUT 1 (P16), GREEN to OUTPUT 2 (P15), ON to OUT 3 (P14), and COLOR sensor to input 1 (P1). Connect the sensor power to the OUTPUT P8. Add "digital write pin P8 to 1" on start after "led enable". Use the analogue reading of the input value in the program. Set the program's operation according to the Input Readings for color matching.

LIGHT CONTROLL - POTO sensor (ANALOGUE) - RECOGNIZING BLACK LINETOP
spajanje09_mb.jpg

Connect the RED lamp to OUT 1 (P16), and the PHOTO sensor to input 1 (P1). Use the analogue reading of the input value in the program. Base should be illuminated. You can do a test by turning the sensor towards the light.

LIGHT CONNTROL - POTO sensor (ANALOGUE)TOP
spajanje08_mb.jpg

Connect the RED lamp to OUT 1 (P16), and the PHOTO sensor to input 1 (P1). Use the analogue reading of the input value in the program.

LIGHT CONTROLL - MAGNETIC sensor (DIGITALLY) 4TOP
spajanje07_mb.jpg

Connect the RED lamp to OUT 1 (P16), and the PHOTO sensor to input 1 (P1). Use the digital reading.

LIGHT CONTROLL - POTO sensor (DIGITALLY) 3TOP
spajanje06_mb.jpg

Connect the RED lamp to OUT 1 (P16), and the PHOTO sensor to input 1 (P1). Use the digital reading.

LIGHT CONTROLL - POTO sensor (DIGITALLY) 2TOP
spajanje05_mb.jpg

Connect the RED lamp to OUT 1 (P16), and the PHOTO sensor to input 1 (P1). Use the digital reading.

LIGHT CONTROLL - PUSH BUTTON (DIGITALLY)TOP
spajanje04_mb.jpg

Connect the RED lamp to OUT 1 (P16), and PUSH BUTTON to the input 1 (P1).

TWO LIGHTS CONTROLL WITH BUTTONS A AND BTOP
spajanje03_mb.jpg

Connect the RED lamp to OUT 1 (P16), and GREEN to OUTPUT 2 (P15).

TWO LIGHTS CONTROLLTOP
spajanje02_mb.jpg

Connect the RED lamp to OUT 1 (P16), and GREEN to OUTPUT 2 (P15).

LIGHT / LED CONTROLLTOP
spajanje01_mb.jpg

Connect the light to OUT 1 (P16).