PROGRAMMING SCHOOL
Programming micro:bit in Python (Mu)
1. LIGHT / LED CONTROLL8. LIGHT CONNTROL - POTO sensor (ANALOGUE)
2. TWO LIGHTS CONTROLL9. LIGHT CONTROLL - POTO sensor (ANALOGUE) - RECOGNIZING BLACK LINE
3. TWO LIGHTS CONTROLL WITH BUTTONS A AND B10. COLOR SENZOR (FischerTechnik) - COLOR recognition
4. LIGHT CONTROLL - PUSH BUTTON (DIGITALNO)11. MOTOR - ROTATION CONTROL WITH BUTTONS "A" AND "B"
5. LIGHT CONTROLL - POTO sensor (DIGITALLY)12. Controling LEDs with Potentiometer
6. LIGHT CONTROLL - POTO sensor (DIGITALLY) 213. ENCODER MOTOR - COUNTER CONTROL
7. LIGHT CONTROLL - POTO sensor (DIGITALLY) B14. STEP MOTOR

LIGHT / LED CONTROLL
spajanje01_mb.jpg

Connect the light to OUT 1 (P16).

TWO LIGHTS CONTROLL
spajanje02_mb.jpg

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

TWO LIGHTS CONTROLL WITH BUTTONS A AND B
spajanje03_mb.jpg

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

LIGHT CONTROLL - PUSH BUTTON (DIGITALNO)
spajanje04_mb.jpg

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

LIGHT CONTROLL - POTO sensor (DIGITALLY)
spajanje05_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 - POTO sensor (DIGITALLY) 2
spajanje06_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 - POTO sensor (DIGITALLY) B
spajanje07_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 CONNTROL - POTO sensor (ANALOGUE)
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 - POTO sensor (ANALOGUE) - RECOGNIZING BLACK LINE
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.

COLOR SENZOR (FischerTechnik) - COLOR recognition
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 BATTERY connector (9V). Use the analogue reading of the input value in the program. Set the program's operation according to the Input Readings for color matching.

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

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

Controling LEDs with Potentiometer
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.

ENCODER MOTOR - COUNTER CONTROL
spajanje19_mb.jpg

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

STEP MOTOR
spajanje20_mb.jpg

Example of stepper motor control in FULL step mode and HALF step mode. The speed is adjusted with the delay command. For this example, we used a motor that runs at 5V and supports a maximum of 180 steps for full speed. A step counter should be placed in the program for accurate control. Stepper motors are big consumers and care should be taken not to draw too much electricity as the drivers will get very hot. We use a voltage of 5V to power the F5 board and micro:bit.