MakeCode JoyCar Sensors

Ultrasonic sensor

Check the ultrasonic sensor for the distance to the nearest detected object. The function returns the distance in response.


Checks the left/right speed sensor whether the signal was interrupted by the perforated disk. The function returns True or False.

Obstacle Sensors

Checks the left/right obstacle sensor to see if an obstacle has been detected. The function returns True or False.

Linefinder Sensors

Checks the left/middle/right linefinder sensor whether a line on the floor could be detected. The function returns true or false (True/False) as answer.

01 Sensors

In this example, as soon as button A is pressed, the distance to the nearest object is measured and displayed via the ultrasonic sensor.

02 Sensors

For this example, the Joy-Car must stand on a white sheet of paper. If a black strip is now moved under one of the three Linefinder sensors, a line appears on the display of the Micro:bit. Depending on the sensor in use, the line is arranged on the left, in the middle, or on the right. The corresponding blinker is activated if the black strip is pushed under the left or right linefinder sensor.

03 Sensors

In this example, the obstacle sensors are activated. As soon as an obstacle is pushed in front of the Joy-Car, the Joy-Car automatically moves back to a certain distance.

04 Sensors

In this example, the speed sensor is activated. The left wheel of the Joy-Car can be turned by hand here. The perforated disc fields are then automatically counted and displayed on the console via the serial interface.

05 Sensors

Here, the speed sensors are used to rotate one full rotation per wheel in succession.


Ihr Webbrowser ist veraltet. Wechseln Sie jetzt zu einem aktuellen Browser für mehr Sicherheit, Geschwindigkeit und den besten Komfort auf dieser Seite.