Documentation

Una is developed by Una Technologies Limited

All rights reserved

© 2022 Una Technologies Limited

Print

Reading the Current Value of Rotary Angle Sensor

Rotary Angle Sensor read port

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"Grove_rotaryAngleSensorRead\" disabled=\"true\" x=\"112\" y=\"292\"><field name=\"channel\">GroveAnalogPort.A0</field></block></xml>"}
				
			

This is used for reading the current value from the rotary angle sensor.

Parameters: N/A

Condition: A0 (Default)/A2/A4/A6

Output: Number
Sample code:

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>index</variable></variables><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"pxt_controls_for\"><value name=\"VAR\"><shadow type=\"variables_get_reporter\"><field name=\"VAR\">index</field></shadow></value><value name=\"TO\"><shadow type=\"math_whole_number\"><field name=\"NUM\">10</field></shadow></value><statement name=\"DO\"><block type=\"basic_consoleLogNum\"><value name=\"num\"><block type=\"Grove_rotaryAngleSensorRead\"><field name=\"channel\">GroveAnalogPort.A0</field></block></value><next><block type=\"basic_sleep\"><value name=\"ms\"><shadow type=\"math_number\"><field name=\"NUM\">1000</field></shadow></value></block></next></block></statement></block></statement></block></xml>"}
				
			

The output:

Rotary Angle Sensor Read Port - Output 1
Rotary Angle Sensor Read Port - Output 2
Previous Reading the Current Light Value
Next Scanning the Current Value from Ultrasonic Ranger Read Sensor