Documentation

Una is developed by Una Technologies Limited

All rights reserved

© 2022 Una Technologies Limited

Print

Set the Motor Driver Speed

Motor Driver : set motor M1 with speed

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>MotorDriver</variable></variables><block type=\"Grove_MotorDriver_setMotorOffset\" disabled=\"true\" x=\"23\" y=\"383\"><field name=\"motor\">GroveMotorDriverConstant.M1</field><value name=\"MotorDriver\"><block type=\"variables_get\" disabled=\"true\"><field name=\"VAR\">MotorDriver</field></block></value><value name=\"speed\"><shadow type=\"math_number_minmax\" disabled=\"true\"><mutation min=\"0\" max=\"100\" label=\"Offset\" precision=\"0\"/><field name=\"SLIDER\">0</field></shadow></value></block></xml>"}
				
			

This is used for setting the motor driver speed to make the motor driver move.

Parameters:Motor Driver

Condition: 

      • M1 (Default)/M2
      • Number (Default: 0)

Output: N/A
Sample code:

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>MotorDriver</variable></variables><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"variables_set\"><field name=\"VAR\">MotorDriver</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"Grove_createMotorDriver\"><field name=\"s1\">Switch.ON</field><field name=\"s2\">Switch.ON</field><field name=\"s3\">Switch.ON</field><field name=\"s4\">Switch.ON</field></block></value><next><block type=\"Grove_MotorDriver_setMotorOffset\"><field name=\"motor\">GroveMotorDriverConstant.M1</field><value name=\"MotorDriver\"><block type=\"variables_get\"><field name=\"VAR\">MotorDriver</field></block></value><value name=\"speed\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"100\" label=\"Number\" precision=\"0\"/><field name=\"SLIDER\">100</field></shadow></value></block></next></block></statement></block></xml>"}
				
			

The output:

Motor Driver : set motor M1 with speed - Output 1
Motor Driver : set motor M1 with speed - Output 2
Previous Set the Address of Motor Driver