Valenta extensions

Do you want to build your own code? Why don't you try coding with Valenta extensions? They are very easy-to-use predefined blocks of codes. Let's open MakeCode editor and click Extensions in the menu.

In the search box, type https://github.com/4Tronix/Valenta and click the Valenta extensions.

Valenta extensions are added in the menu. You can make use of motors, servos, and fireLEDs blocks of code in many ways.


Board Model blocks

This group of blocks is primarily used when we first code on start block. Various motor controllers are available for your projects. For Valenta Off-Roader, we use the motor controller called Valenta Zero to run two micro motors on the rear wheels. Thus, we will drag and drop select board model zero within on start block, so that "receiver" micro:bit can recognize its configuration when you start.


Motors blocks

You can drag and drop various blocks to control the micro motors on the car. You can set the direction (forward or backward), the speed (0 to 100 max), and the time for running (1000 millisecond or 1 second, for example) depending on how you want to set up the action of your car. Of course, you can individually control each motor (motor 1 or motor 2) or let them move in opposite ways so that the car can spin left or right.


Servos blocks

You can use these blocks if you want to swing the servo to the angle you want or if you want to adjust its angle by little. 

For example, if the car's steering is a little left, you can offset -5 degrees to the right. Because Pin 8 (P8) is used for the servo on the board, define the block such as offset servo 8 by -5 degrees. Likewise, if the car's steering is a little right, you can offset 5 degrees to the left by defining the code such as offset servo 8 by 5 degrees.

If you want to use your own micro servo (not the one in the kit), you might need to find its own central degree. Suppose your own micro servo swings at the range -90 to 90 degrees and if its central degree is 0 degrees in the middle, then set servo 8 to angle 0 in your code.


FireLed blocks

If you look at Valenta Zero motor controller on the car, it has x4 FireLeds numbered 0, 1, 2 and 3. This group of blocks will light up these FireLeds in many ways. For example, you can pick colors (or your own RGB color), set the lighting time and adjust its brightness based on your preference.