User Manual
Print

Get the port result

Digital read port

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>photo</variable><variable>faceDetectionResult</variable></variables><block type=\"Grove_digitalRead\" disabled=\"true\" x=\"158\" y=\"293\"><field name=\"port\">GroveDigitalPort.D5</field></block></xml>"}
				
			

This is used to get the value from the specific port.

Parameters: N/A

Condition: D5 (Default)/D16/D18/D22/D26

Output: Number
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=\"basic_consoleLogNum\"><value name=\"num\"><block type=\"Grove_digitalRead\"><field name=\"port\">GroveDigitalPort.D5</field></block></value></block></statement></block></xml>"}
				
			

The output:

Digital Read Port - Output