Documentation

Una is developed by Una Technologies Limited

All rights reserved

© 2022 Una Technologies Limited

Print

Change Motor Direction

Servo write port to degree

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"Grove_servoDegreeSet\" disabled=\"true\" x=\"23\" y=\"607\"><field name=\"port\">GrovePWMPort.PWM</field><value name=\"degree\"><shadow type=\"math_number_minmax\" disabled=\"true\"><mutation min=\"0\" max=\"180\" label=\"Degree\" precision=\"0\"/><field name=\"SLIDER\">90</field></shadow></value></block></xml>"}
				
			

This is used to change the angle of the motor.

Parameters: N/A

Condition: 

      • PWM(Default)/D5/D16/D18/D22/D26
      • Number(Default: 90)

Output: Motor
Sample code:

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"Grove_servoDegreeSet\"><field name=\"port\">GrovePWMPort.PWM</field><value name=\"degree\"><shadow type=\"math_number_minmax\"><mutation min=\"0\" max=\"180\" label=\"Number\" precision=\"0\"/><field name=\"SLIDER\">90</field></shadow></value></block></statement></block></xml>"}
				
			

The output:

Servo Write Port to Degree - Output 1
Servo Write Port to Degree - Output 2
Servo Write Port to Degree - Output 3