[vc_row][vc_column][vc_column_text]
Linker Tilt is a tilt sensor in the linker series product.Its interior is composed by metal ball and two touch spot.
It could still work without the precise tilt measuring environment.
Compare to the gyroscope,it costs less and operates simpler.[/vc_column_text][vc_tour][vc_tab title=”Part list” tab_id=”1393403997-1-2″][vc_column_text]1.pcDuino v2 x1
2.Linker base shield x1
3.pcDuino linker kit 20cm cable
4.Linker tilt x1[/vc_column_text][/vc_tab][vc_tab title=”Wiring Diagram” tab_id=”1393403997-2-15″][vc_column_text]
Linker tilt is connected to A2 port through the Linker kit 20 cm cable.
Then power on the pcDuino.[/vc_column_text][/vc_tab][vc_tab title=”Test code” tab_id=”1393462876238-2-4″][vc_column_text]
#include <core.h> int tilt_pin = A2; int tilt_data = 0; void setup (){ Serial.begin (9600); pinMode (tilt_pin, INPUT); } void loop (){ tilt_data = analogRead (tilt_pin); if (tilt_data){ Serial.println ("I'm shaking!n"); } else { Serial.println ("keep balance!n"); } delay(500); }
[/vc_column_text][/vc_tab][vc_tab title=”Test result” tab_id=”1393462877534-3-8″][vc_column_text]Open the serial port tools,it will show ‘keep balance’ under normal circumstances.
When we tilt the module to the right,the screen shows ‘I’m shaking’ and indicate the module tilt.
Return to its original position and the screen will continue to show ‘keep balance’.
[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.