User Manual
Print

Reading the Current Light Value

Light Sensor read port

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>GestureSensor</variable></variables><block type=\"Grove_groveLightSensorRead\" disabled=\"true\" x=\"-22\" y=\"247\"><field name=\"channel\">GroveAnalogPort.A0</field></block></xml>"}
				
			

This is used for reading the current light value from the light sensor.

Parameters: N/A

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

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_groveLightSensorRead\"><field name=\"channel\">GroveAnalogPort.A0</field></block></value></block></statement></block></xml>"}
				
			

The output:

Light Senso Read Port - Output