{"id":3886,"date":"2020-11-26T06:13:41","date_gmt":"2020-11-25T23:13:41","guid":{"rendered":"https:\/\/www.phidgets.com\/education\/?page_id=3886"},"modified":"2022-12-14T02:16:55","modified_gmt":"2022-12-13T19:16:55","slug":"accelerometer-sensor","status":"publish","type":"page","link":"https:\/\/www.phidgets.com\/education\/learn\/device-tutorials\/accelerometer-sensor\/","title":{"rendered":"Accelerometer sensor"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221;][et_pb_row column_structure=&#8221;1_2,1_2&#8243; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;1_2&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Accelerometer Sensor&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<div class=\"ph-has-adjacent-panel\"><!-- [et_pb_line_break_holder] -->  <\/p>\n<div class=\"ph-overline-text\"><a href=\"\/education\/learn\/device-tutorials\">Device tutorials<\/a><\/div>\n<p><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->  <\/p>\n<h1>Accelerometer Phidget<\/h1>\n<p><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->  <pee>The Accelerometer Phidget contains a 3-axis accelerometer. The accelerometer measures acceleration in units of g-force. A stationary object experiences 1 g of acceleration due to the Earth&#8217;s gravitational field. A high-speed roller coaster typically develops 4 g to 6 g.<\/pee><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><a class=\"ph-button-link\" href=\"\/education\/learn\/device-tutorials\/spatial-sensor\/#tutorial\"><!-- [et_pb_line_break_holder] -->  <\/p>\n<div class=\"ph-button-link__icon\"><\/div>\n<p><!-- [et_pb_line_break_holder] -->  See tutorial<!-- [et_pb_line_break_holder] --><\/a><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><\/div>\n<p>[\/et_pb_code][\/et_pb_column][et_pb_column type=&#8221;1_2&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/11\/device-accelerometer.png&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; use_custom_gutter=&#8221;on&#8221; gutter_width=&#8221;3&#8243; specialty=&#8221;on&#8221; module_id=&#8221;tutorial&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;1_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;ph-vertical-nav&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<div class=\"ph-vertical-nav ph-vertical-sticky\"><!-- [et_pb_line_break_holder] -->  <a href=\"#setup\" class=\"ph-vertical-nav-item active\">Setup<\/a><!-- [et_pb_line_break_holder] -->  <a href=\"#write-code\" class=\"ph-vertical-nav-item\">Code<\/a><!-- [et_pb_line_break_holder] -->  <a href=\"#applications\" class=\"ph-vertical-nav-item\">Applications<\/a><!-- [et_pb_line_break_holder] -->  <a href=\"#practice\" class=\"ph-vertical-nav-item\">Practice<\/a><!-- [et_pb_line_break_holder] --><\/div>\n<p>[\/et_pb_code][\/et_pb_column][et_pb_column type=&#8221;3_4&#8243; specialty_columns=&#8221;3&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_row_inner module_id=&#8221;setup&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Setup&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3>Setup<\/h3>\n<p><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>Before you do any coding you will have to attach your Accelerometer Phidget to your VINT Hub as shown:<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2022\/12\/MOT1100_0_setup_white.jpg&#8221; title_text=&#8221;MOT1100_0_setup_white&#8221; _builder_version=&#8221;4.19.2&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; hover_enabled=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221; show_in_lightbox=&#8221;on&#8221; sticky_enabled=&#8221;0&#8243;][\/et_pb_image][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner module_id=&#8221;write-code&#8221; module_class=&#8221;ph-hidden-anchor&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Write Code &#8211; row hidden anchor&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner module_class=&#8221;ph-user-java&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Code (Java)&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3>Code (Java)<\/h3>\n<p><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>Create a file called <em>Accel<\/em> and insert the following code. Run your code. Move your Accelerometer Phidget to see the output change.<\/pee><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>Not your programming language? <a class=\"ph-toggle-settings\">Set my language and IDE<\/a>.<\/pee>[\/et_pb_code][et_pb_code admin_label=&#8221;Code Sample &#8211; Netbeans&#8221; module_class=&#8221;ph-user-netbeans&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<!-- Device tutorials: accelerometer--><!-- [et_pb_line_break_holder] --><\/p>\n<pre class=\"language-java\"><!-- [et_pb_line_break_holder] -->  <code><!-- [et_pb_line_break_holder] -->package accelerometer;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->\/\/Add Phidgets Library<!-- [et_pb_line_break_holder] -->import com.phidget22.*;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->public class Accel{<!-- [et_pb_line_break_holder] -->    public static void main(String[] args) throws Exception {<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Create<!-- [et_pb_line_break_holder] -->        Accelerometer accelerometer = new Accelerometer();<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Open<!-- [et_pb_line_break_holder] -->        accelerometer.open(1000);<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Use your Phidgets<!-- [et_pb_line_break_holder] -->        while (true) {<!-- [et_pb_line_break_holder] -->            System.out.println(\"Acceleration: x = \" + accelerometer.getAcceleration()[0] + \" g | y = \" + accelerometer.getAcceleration()[1] + \" g | z = \" + accelerometer.getAcceleration()[2]+ \" g\");<!-- [et_pb_line_break_holder] -->            Thread.sleep(250);<!-- [et_pb_line_break_holder] -->        }<!-- [et_pb_line_break_holder] -->    }<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] -->  <\/code><!-- [et_pb_line_break_holder] --><\/pre>\n<p>[\/et_pb_code][et_pb_code admin_label=&#8221;Code Sample &#8211; Eclipse&#8221; module_class=&#8221;ph-user-eclipse&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<!-- Device tutorials: accelerometer--><!-- [et_pb_line_break_holder] --><\/p>\n<pre class=\"language-java\"><!-- [et_pb_line_break_holder] -->  <code><!-- [et_pb_line_break_holder] -->\/\/Add Phidgets Library<!-- [et_pb_line_break_holder] -->import com.phidget22.*;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->public class Accel{<!-- [et_pb_line_break_holder] -->    public static void main(String[] args) throws Exception {<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Create<!-- [et_pb_line_break_holder] -->        Accelerometer accelerometer = new Accelerometer();<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Open<!-- [et_pb_line_break_holder] -->        accelerometer.open(1000);<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Use your Phidgets<!-- [et_pb_line_break_holder] -->        while (true) {<!-- [et_pb_line_break_holder] -->            System.out.println(\"Acceleration: x = \" + accelerometer.getAcceleration()[0] + \" g | y = \" + accelerometer.getAcceleration()[1] + \" g | z = \" + accelerometer.getAcceleration()[2]+ \" g\");<!-- [et_pb_line_break_holder] -->            Thread.sleep(250);<!-- [et_pb_line_break_holder] -->        }<!-- [et_pb_line_break_holder] -->    }<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] -->  <\/code><!-- [et_pb_line_break_holder] --><\/pre>\n<p>[\/et_pb_code][et_pb_code admin_label=&#8221;Code Sample &#8211; Processing&#8221; module_class=&#8221;ph-user-processing&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<!-- Device tutorials: accelerometer--><!-- [et_pb_line_break_holder] --><\/p>\n<pre class=\"language-java\"><!-- [et_pb_line_break_holder] -->  <code><!-- [et_pb_line_break_holder] -->\/\/Add Phidgets Library<!-- [et_pb_line_break_holder] -->import com.phidget22.*;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->\/\/Define<!-- [et_pb_line_break_holder] -->Accelerometer accelerometer;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->void setup(){<!-- [et_pb_line_break_holder] -->  try{<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->    \/\/Create <!-- [et_pb_line_break_holder] -->     accelerometer = new Accelerometer();<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->    \/\/Open<!-- [et_pb_line_break_holder] -->    accelerometer.open(1000);<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->  }catch(Exception e){<!-- [et_pb_line_break_holder] -->    e.printStackTrace();<!-- [et_pb_line_break_holder] -->  }<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->void draw(){<!-- [et_pb_line_break_holder] -->  try{<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->    \/\/Use your Phidgets<!-- [et_pb_line_break_holder] -->    println(\"Acceleration: x = \" + accelerometer.getAcceleration()[0] + \" g | y = \" + accelerometer.getAcceleration()[1] + \" g | z = \" + accelerometer.getAcceleration()[2]+ \" g\");<!-- [et_pb_line_break_holder] -->    delay(250);<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->  }catch(Exception e){<!-- [et_pb_line_break_holder] -->    e.printStackTrace();<!-- [et_pb_line_break_holder] -->  }<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] -->  <\/code><!-- [et_pb_line_break_holder] --><\/pre>\n<p>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner module_class=&#8221;ph-user-python&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Code (Python)&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3>Code (Python)<\/h3>\n<p><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>Create a file called <em>Accelerometer<\/em> and insert the following code. Run your code. Move your AccelerometerPhidget to see the output change.<\/pee><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>Not your programming language? <a class=\"ph-toggle-settings\">Set my language and IDE<\/a>.<\/pee>[\/et_pb_code][et_pb_code admin_label=&#8221;Code sample&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<!-- Device tutorials: accelerometer--><!-- [et_pb_line_break_holder] --><\/p>\n<pre class=\"language-python\"><!-- [et_pb_line_break_holder] -->  <code><!-- [et_pb_line_break_holder] -->#Add Phidgets Library<!-- [et_pb_line_break_holder] -->from Phidget22.Phidget import *<!-- [et_pb_line_break_holder] -->from Phidget22.Devices.Accelerometer import *<!-- [et_pb_line_break_holder] -->#Required for sleep statement<!-- [et_pb_line_break_holder] -->import time<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->#Create<!-- [et_pb_line_break_holder] -->accelerometer = Accelerometer()<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->#Open<!-- [et_pb_line_break_holder] -->accelerometer.openWaitForAttachment(1000)<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->#Use your Phidgets<!-- [et_pb_line_break_holder] -->while (True):<!-- [et_pb_line_break_holder] -->    print(\"Acceleration: x = \" + str(accelerometer.getAcceleration()[0]) + \" g | y = \" + str(accelerometer.getAcceleration()[1]) +\" g | z = \" + str(accelerometer.getAcceleration()[2]))<!-- [et_pb_line_break_holder] -->    time.sleep(0.25)<!-- [et_pb_line_break_holder] -->  <\/code><!-- [et_pb_line_break_holder] --><\/pre>\n<p>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner module_class=&#8221;ph-user-csharp&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Code (C#)&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3>Code (C#)<\/h3>\n<p><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>Create a file called <em>Accelerometer<\/em> and insert the following code. Run your code. Move your AccelerometerPhidget to see the output change.<\/pee><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>Not your programming language? <a class=\"ph-toggle-settings\">Set my language and IDE<\/a>.<\/pee>[\/et_pb_code][et_pb_code admin_label=&#8221;Code sample&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<!-- Device tutorials: accelerometer--><!-- [et_pb_line_break_holder] --><\/p>\n<pre class=\"language-csharp\"><!-- [et_pb_line_break_holder] -->  <code><!-- [et_pb_line_break_holder] -->\/\/Add Phidgets Library<!-- [et_pb_line_break_holder] -->using Phidget22;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->namespace Accel{<!-- [et_pb_line_break_holder] -->    class Program{<!-- [et_pb_line_break_holder] -->        static void Main(string[] args){<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->            \/\/Create<!-- [et_pb_line_break_holder] -->            Accelerometer accelerometer = new Accelerometer();<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->            \/\/Open<!-- [et_pb_line_break_holder] -->            accelerometer.Open(1000);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->            \/\/Use your Phidgets<!-- [et_pb_line_break_holder] -->            while (true)<!-- [et_pb_line_break_holder] -->            {<!-- [et_pb_line_break_holder] -->                System.Console.WriteLine(\"Acceleration: x = \" + accelerometer.Acceleration[0] + \"g | y = \" + accelerometer.Acceleration[1] + \"g | z = \" + accelerometer.Acceleration[2] + \"g\");<!-- [et_pb_line_break_holder] -->                System.Threading.Thread.Sleep(250);<!-- [et_pb_line_break_holder] -->            }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->        }<!-- [et_pb_line_break_holder] -->    }<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] -->  <\/code><!-- [et_pb_line_break_holder] --><\/pre>\n<p>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner module_class=&#8221;ph-user-swift&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Code (Swift)&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3>Code (Swift)<\/h3>\n<p><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>Create a file called <em>Accelerometer<\/em> and insert the following code. Run your code. Move your Accelerometer Phidget to see the output change.<\/pee><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>Not your programming language? <a class=\"ph-toggle-settings\">Set my language and IDE<\/a>.<\/pee><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>You will need to add three Labels.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/04\/spatial-1.png&#8221; disabled_on=&#8221;off|off|off&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_code admin_label=&#8221;Code sample&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<!-- Device tutorials: accelerometer--><!-- [et_pb_line_break_holder] --><\/p>\n<pre class=\"language-swift\"><!-- [et_pb_line_break_holder] -->  <code><!-- [et_pb_line_break_holder] -->import Cocoa<!-- [et_pb_line_break_holder] -->\/\/Add Phidget Library<!-- [et_pb_line_break_holder] -->import Phidget22Swift<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->class ViewController: NSViewController {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->    @IBOutlet weak var xLabel: NSTextField!<!-- [et_pb_line_break_holder] -->    @IBOutlet weak var yLabel: NSTextField!<!-- [et_pb_line_break_holder] -->    @IBOutlet weak var zLabel: NSTextField!<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->    \/\/Create<!-- [et_pb_line_break_holder] -->    let accelerometer = Accelerometer()<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->    override func viewDidLoad() {<!-- [et_pb_line_break_holder] -->        super.viewDidLoad()<!-- [et_pb_line_break_holder] -->        do{<!-- [et_pb_line_break_holder] -->            \/\/Subscribe to event<!-- [et_pb_line_break_holder] -->            let _ = accelerometer.accelerationChange.addHandler(onAccelerationChange)<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->            \/\/Open<!-- [et_pb_line_break_holder] -->            try accelerometer.open()<!-- [et_pb_line_break_holder] -->        }catch{<!-- [et_pb_line_break_holder] -->            print(error)<!-- [et_pb_line_break_holder] -->        }<!-- [et_pb_line_break_holder] -->    }<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->    func onAccelerationChange(sender:Accelerometer, data: (acceleration:[Double], timestamp: Double)){<!-- [et_pb_line_break_holder] -->        DispatchQueue.main.async {<!-- [et_pb_line_break_holder] -->\t    \/\/Use information from your Phidget to change label<!-- [et_pb_line_break_holder] -->            self.xLabel.stringValue = \"X-axis: \" + String(data.acceleration[0]) + \"g\"<!-- [et_pb_line_break_holder] -->            self.yLabel.stringValue = \"Y-axis: \" + String(data.acceleration[1]) + \"g\"<!-- [et_pb_line_break_holder] -->            self.zLabel.stringValue = \"Z-axis: \" + String(data.acceleration[2]) + \"g\"<!-- [et_pb_line_break_holder] -->        }<!-- [et_pb_line_break_holder] -->    }<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] -->  <\/code><!-- [et_pb_line_break_holder] --><\/pre>\n<p>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner module_id=&#8221;applications&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Applications&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3>Applications<\/h3>\n<p><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>If you have been using a phone or tablet, you may have noticed that the screen contents will rotate when you rotate your phone. That is an accelerometer in action!<\/pee><!-- [et_pb_line_break_holder] --><\/p>\n<ul><!-- [et_pb_line_break_holder] --><\/p>\n<li>Accelerometers are used to detect eartquakes and measure the impact.<\/li>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<li>Modern vehicles use accelerometers as &#8220;crash sensors&#8221; to detect when an accident happens and deploy the airbags.<\/li>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<li>Sensitive production lines (e.g. hard drive manufacturing) may use accelerometers in order to monitor and maintain quality.<\/li>\n<p><!-- [et_pb_line_break_holder] --><\/ul>\n<p>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner column_structure=&#8221;1_3,1_3,1_3&#8243; admin_label=&#8221;Row&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner type=&#8221;1_3&#8243; saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/04\/spatial-2.jpg&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][\/et_pb_column_inner][et_pb_column_inner type=&#8221;1_3&#8243; saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/04\/spatial-3.jpg&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][\/et_pb_column_inner][et_pb_column_inner type=&#8221;1_3&#8243; saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2020\/04\/spatial-4.jpg&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner module_id=&#8221;practice&#8221; module_class=&#8221;ph-hidden-anchor&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Practice &#8211; row hidden anchor&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code admin_label=&#8221;Practice&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3>Practice<\/h3>\n<p><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><pee>Create the beginning fall detection system using your Spatial Phidget and Getting Started Kit. <\/pee><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><\/p>\n<ol><!-- [et_pb_line_break_holder] --><\/p>\n<li>When the Phidget is sitting flat on your desk, turn on the green LED.  <\/li>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<li>When the Spatial Phidget moves, turn on the Red LED. <\/li>\n<p><!-- [et_pb_line_break_holder] --><\/ol>\n<p><!-- [et_pb_line_break_holder] -->[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner disabled_on=&#8221;off|off|off&#8221; module_id=&#8221;documentation&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text admin_label=&#8221;API Disclaimer&#8221; _builder_version=&#8221;4.6.6&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; text_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; text_text_shadow_vertical_length_tablet=&#8221;0px&#8221; text_text_shadow_blur_strength_tablet=&#8221;1px&#8221; link_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; link_text_shadow_vertical_length_tablet=&#8221;0px&#8221; link_text_shadow_blur_strength_tablet=&#8221;1px&#8221; ul_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; ul_text_shadow_vertical_length_tablet=&#8221;0px&#8221; ul_text_shadow_blur_strength_tablet=&#8221;1px&#8221; ol_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; ol_text_shadow_vertical_length_tablet=&#8221;0px&#8221; ol_text_shadow_blur_strength_tablet=&#8221;1px&#8221; quote_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; quote_text_shadow_vertical_length_tablet=&#8221;0px&#8221; quote_text_shadow_blur_strength_tablet=&#8221;1px&#8221; header_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; header_text_shadow_vertical_length_tablet=&#8221;0px&#8221; header_text_shadow_blur_strength_tablet=&#8221;1px&#8221; header_2_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; header_2_text_shadow_vertical_length_tablet=&#8221;0px&#8221; header_2_text_shadow_blur_strength_tablet=&#8221;1px&#8221; header_3_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; header_3_text_shadow_vertical_length_tablet=&#8221;0px&#8221; header_3_text_shadow_blur_strength_tablet=&#8221;1px&#8221; header_4_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; header_4_text_shadow_vertical_length_tablet=&#8221;0px&#8221; header_4_text_shadow_blur_strength_tablet=&#8221;1px&#8221; header_5_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; header_5_text_shadow_vertical_length_tablet=&#8221;0px&#8221; header_5_text_shadow_blur_strength_tablet=&#8221;1px&#8221; header_6_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; header_6_text_shadow_vertical_length_tablet=&#8221;0px&#8221; header_6_text_shadow_blur_strength_tablet=&#8221;1px&#8221; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; global_module=&#8221;3821&#8243; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p>Check out the advanced lesson <a href=\"https:\/\/www.phidgets.com\/education\/learn\/getting-started-kit-tutorial\/getting-started-kit-advanced-11-sensorapi\/\" target=\"_blank\" rel=\"noopener noreferrer\">Using the Sensor API<\/a> before you use the API for the first time.<\/p>\n<p>[\/et_pb_text][et_pb_toggle title=&#8221;API&#8221; admin_label=&#8221;API&#8221; module_id=&#8221;api-MOT1100_0&#8243; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; title_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; title_text_shadow_vertical_length_tablet=&#8221;0px&#8221; title_text_shadow_blur_strength_tablet=&#8221;1px&#8221; closed_title_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; closed_title_text_shadow_vertical_length_tablet=&#8221;0px&#8221; closed_title_text_shadow_blur_strength_tablet=&#8221;1px&#8221; body_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; body_text_shadow_vertical_length_tablet=&#8221;0px&#8221; body_text_shadow_blur_strength_tablet=&#8221;1px&#8221; body_link_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; body_link_text_shadow_vertical_length_tablet=&#8221;0px&#8221; body_link_text_shadow_blur_strength_tablet=&#8221;1px&#8221; body_ul_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; body_ul_text_shadow_vertical_length_tablet=&#8221;0px&#8221; body_ul_text_shadow_blur_strength_tablet=&#8221;1px&#8221; body_ol_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; body_ol_text_shadow_vertical_length_tablet=&#8221;0px&#8221; body_ol_text_shadow_blur_strength_tablet=&#8221;1px&#8221; body_quote_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; body_quote_text_shadow_vertical_length_tablet=&#8221;0px&#8221; body_quote_text_shadow_blur_strength_tablet=&#8221;1px&#8221; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; text_shadow_horizontal_length_tablet=&#8221;0px&#8221; text_shadow_vertical_length_tablet=&#8221;0px&#8221; text_shadow_blur_strength_tablet=&#8221;1px&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_toggle][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner disabled_on=&#8221;on|on|on&#8221; module_id=&#8221;troubleshoot&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; z_index_tablet=&#8221;0&#8243; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; disabled=&#8221;on&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;3_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_toggle title=&#8221;Troubleshoot&#8221; admin_label=&#8221;Troubleshoot&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; title_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; title_text_shadow_vertical_length_tablet=&#8221;0px&#8221; title_text_shadow_blur_strength_tablet=&#8221;1px&#8221; closed_title_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; closed_title_text_shadow_vertical_length_tablet=&#8221;0px&#8221; closed_title_text_shadow_blur_strength_tablet=&#8221;1px&#8221; body_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; body_text_shadow_vertical_length_tablet=&#8221;0px&#8221; body_text_shadow_blur_strength_tablet=&#8221;1px&#8221; body_link_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; body_link_text_shadow_vertical_length_tablet=&#8221;0px&#8221; body_link_text_shadow_blur_strength_tablet=&#8221;1px&#8221; body_ul_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; body_ul_text_shadow_vertical_length_tablet=&#8221;0px&#8221; body_ul_text_shadow_blur_strength_tablet=&#8221;1px&#8221; body_ol_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; body_ol_text_shadow_vertical_length_tablet=&#8221;0px&#8221; body_ol_text_shadow_blur_strength_tablet=&#8221;1px&#8221; body_quote_text_shadow_horizontal_length_tablet=&#8221;0px&#8221; body_quote_text_shadow_vertical_length_tablet=&#8221;0px&#8221; body_quote_text_shadow_blur_strength_tablet=&#8221;1px&#8221; box_shadow_horizontal_tablet=&#8221;0px&#8221; box_shadow_vertical_tablet=&#8221;0px&#8221; box_shadow_blur_tablet=&#8221;40px&#8221; box_shadow_spread_tablet=&#8221;0px&#8221; text_shadow_horizontal_length_tablet=&#8221;0px&#8221; text_shadow_vertical_length_tablet=&#8221;0px&#8221; text_shadow_blur_strength_tablet=&#8221;1px&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<ol>\n<li>Make sure everything is plugged in properly and your VINT Hub is connected to your computer\n<\/li>\n<li>Stop running other programs that are using your Phidgets before running a program.<\/li>\n<\/ol>\n<p>If these do not solve your issue visit the <a href=\"\/education\/learn\/advanced-troubleshooting\/ \" target=\"_blank\" rel=\"noopener noreferrer\">Advanced Troubleshooting Page<\/a>.<\/p>\n<p>[\/et_pb_toggle][\/et_pb_column_inner][\/et_pb_row_inner][\/et_pb_column][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>package accelerometer;\/\/Add Phidgets Libraryimport com.phidget22.*;public class Accel{ public static void main(String[] args) throws Exception { \/\/Create Accelerometer accelerometer = new Accelerometer(); \/\/Open accelerometer.open(1000); \/\/Use your Phidgets while (true) { System.out.println(&#8220;Acceleration: x = &#8221; + accelerometer.getAcceleration()[0] + &#8221; g | y = &#8221; + accelerometer.getAcceleration()[1] + &#8221; g | z = &#8221; + accelerometer.getAcceleration()[2]+ &#8221; g&#8221;); [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":623,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-3886","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/3886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/comments?post=3886"}],"version-history":[{"count":13,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/3886\/revisions"}],"predecessor-version":[{"id":9257,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/3886\/revisions\/9257"}],"up":[{"embeddable":true,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/623"}],"wp:attachment":[{"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/media?parent=3886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}