[vc_row][vc_column width=”1/1″][vc_column_text]Linker Touch Sensor is a touch switch, when a finger touching the sensing area, SIG (signal output) in the Linker Touch Sensor will output a high level (logic 1), when there is no touch SIG will continue to output low (logic 0). Then pcDuino can judge the state of the switch by detection Touch Sensor SIG level through GPIO. Let us control the linker led by Touch Sensor.
[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”Hardware List” tab_id=”1394426983-1-36″][vc_column_text]1. [bigcommerce link=”/pcduino-v2-an-minipc-with-arduino-headers-ubuntu-android-google/” target=”_blank”]pcDuino V2[/bigcommerce] x1
2. [bigcommerce link=”/touch-sensor-module-of-linker-kit-for-pcduino-arduino/” target=”_blank”]Linker Touch Sensor[/bigcommerce] x1
3. [bigcommerce link=”/5mm-blue-led-module-of-linker-kit-for-pcduino-arduino/” target=”_blank”]Linker LED [/bigcommerce] x1
4. [bigcommerce link=”/base-shield-of-linker-kit-for-pcduino-arduino/” target=”_blank”]Linker Base[/bigcommerce] x1
5. [bigcommerce link=”/20-cm-cable-for-linker-kit/” target=”_blank”]Linker cable [/bigcommerce] x2[/vc_column_text][/vc_tab][vc_tab title=”Wiring Diagram” tab_id=”1394426983-2-26″][vc_column_text]
[/vc_column_text][/vc_tab][vc_tab title=”Test Code” tab_id=”1394428942731-2-9″][vc_column_text]
import gpio from time import sleep led_pin = "gpio2" sensor_pin = "gpio3" def delay(ms): sleep(1.0*ms/1000) def setup(): gpio.pinMode(led_pin, gpio.OUTPUT) gpio.pinMode(sensor_pin, gpio.INPUT) print " Linker LED Pin : D2 \n Touch Sensor Pin : D3" def loop(): while(1): if(gpio.digitalRead(sensor_pin)): gpio.digitalWrite(led_pin, gpio.HIGH) else : gpio.digitalWrite(led_pin, gpio.LOW) setup() loop()
[/vc_column_text][/vc_tab][vc_tab title=”Operating results” tab_id=”1394428979333-3-6″][vc_column_text]
[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.