{"id":6674,"date":"2021-08-24T04:08:22","date_gmt":"2021-08-23T21:08:22","guid":{"rendered":"https:\/\/www.phidgets.com\/education\/?page_id=6674"},"modified":"2023-03-14T03:08:58","modified_gmt":"2023-03-13T20:08:58","slug":"calculate-weight","status":"publish","type":"page","link":"https:\/\/www.phidgets.com\/education\/learn\/projects\/scale-kit\/calculate-weight\/","title":{"rendered":"Calculate Weight"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; specialty=&#8221;on&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;1_3&#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-menu&#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-vertical-menu ph-vertical-sticky\"><!-- [et_pb_line_break_holder] -->  <a class=\"ph-vertical-menu-item\" href=\"\/education\/learn\/projects\/scale-kit\/introduction\"><!-- [et_pb_line_break_holder] -->    Introduction<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] -->  <a class=\"ph-vertical-menu-item\" href=\"\/education\/learn\/projects\/scale-kit\/parts\"><!-- [et_pb_line_break_holder] -->    Parts<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] -->  <a class=\"ph-vertical-menu-item\" href=\"\/education\/learn\/projects\/scale-kit\/assemble\"><!-- [et_pb_line_break_holder] -->    Assemble<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] -->  <a class=\"ph-vertical-menu-item\" href=\"\/education\/learn\/projects\/scale-kit\/scale-offset\/\"><!-- [et_pb_line_break_holder] -->    Get the Scale Offset<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] -->  <a class=\"ph-vertical-menu-item active blue\" href=\"\/education\/learn\/projects\/scale-kit\/calculate-weight\/\"><!-- [et_pb_line_break_holder] -->    Calculate Weight<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] --> <a class=\"ph-vertical-menu-subitem\" href=\"#overview\"><!-- [et_pb_line_break_holder] -->    Overview<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] --> <a class=\"ph-vertical-menu-subitem\" href=\"#write-code\"><!-- [et_pb_line_break_holder] -->    Write Code<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] -->  <a class=\"ph-vertical-menu-subitem\" href=\"#run-program\"><!-- [et_pb_line_break_holder] -->    Run Your Program<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] -->  <a class=\"ph-vertical-menu-subitem\" href=\"#default-what\"><!-- [et_pb_line_break_holder] -->    What Is 4700?<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] -->  <a class=\"ph-vertical-menu-subitem\" href=\"#practice\"><!-- [et_pb_line_break_holder] -->    Practice<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] -->  <a class=\"ph-vertical-menu-subitem\" href=\"#troubleshoot\"><!-- [et_pb_line_break_holder] -->    Troubleshoot<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] -->  <a class=\"ph-vertical-menu-item\" href=\"\/education\/learn\/projects\/scale-kit\/accuracy\/\"><!-- [et_pb_line_break_holder] -->    Increasing Accuracy<!-- [et_pb_line_break_holder] -->  <\/a>  <a class=\"ph-vertical-menu-item\" href=\"\/education\/learn\/projects\/scale-kit\/capacity\/\"><!-- [et_pb_line_break_holder] -->    Change Capacity<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] --><\/div>\n<p>[\/et_pb_code][\/et_pb_column][et_pb_column type=&#8221;2_3&#8243; specialty_columns=&#8221;4&#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;overview&#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;2_3&#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;Scale Kit: Calculate Weight&#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-overline-text\"><!-- [et_pb_line_break_holder] --><a href=\"\/education\/learn\/projects\">Projects<\/a><!-- [et_pb_line_break_holder] --><\/div>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<div class=\"ph-pre-h1 ph-color-grey-200\">Phidget Scale Kit<\/div>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<h1>Calculate Weight<\/h1>\n<p>[\/et_pb_code][et_pb_code admin_label=&#8221;Instructions&#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;]<pee>Now that you&#8217;ve calculated your offset value, you will use it to convert your scale&#8217;s output to a weight in kilograms.<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/08\/scale_weight.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_code admin_label=&#8221;Instructions&#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;]<pee><\/pee><!-- [et_pb_line_break_holder] --><pee>You can continue working from your <em>PhidgetScale<\/em> project in this step. Replace your previous code with the following code.<\/pee>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner module_id=&#8221;write-code&#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;2_3&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text disabled_on=&#8221;on|on|on&#8221; admin_label=&#8221;invisible 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; 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; disabled=&#8221;on&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_text][\/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;2_3&#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 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; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2>Write Code (Java)<\/h2>\n<p><!-- [et_pb_line_break_holder] --><pee>Not your programming language? <a class=\"ph-toggle-settings\">Set your preferences<\/a> so we can display relevant code examples.<\/pee><!-- [et_pb_line_break_holder] -->[\/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;]<\/p>\n<pre class=\"language-java\"><!-- [et_pb_line_break_holder] -->  <code><!-- [et_pb_line_break_holder] -->package phidgetscale;<!-- [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 PhidgetScale {<!-- [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] -->        VoltageRatioInput scale = new VoltageRatioInput();<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Open<!-- [et_pb_line_break_holder] -->        scale.open(1000);<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Use your Offset Value<!-- [et_pb_line_break_holder] -->        double offsetValue = INSERT VALUE HERE<!-- [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] -->            \/\/Calculate Weight (kg)<!-- [et_pb_line_break_holder] -->            double weight = 4700 * (scale.getVoltageRatio() - offsetValue);<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->            \/\/Display Weight<!-- [et_pb_line_break_holder] -->            System.out.println(String.format(\"%.3f kg\", weight));      <!-- [et_pb_line_break_holder] -->            <!-- [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;]<\/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 PhidgetScale {<!-- [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] -->        VoltageRatioInput scale = new VoltageRatioInput();<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Open<!-- [et_pb_line_break_holder] -->        scale.open(1000);<!-- [et_pb_line_break_holder] -->        <!-- [et_pb_line_break_holder] -->        \/\/Use your Offset Value<!-- [et_pb_line_break_holder] -->        double offsetValue = INSERT VALUE HERE<!-- [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] -->            \/\/Calculate Weight (kg)<!-- [et_pb_line_break_holder] -->            double weight = 4700 * (scale.getVoltageRatio() - offsetValue);<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->            \/\/Display Weight<!-- [et_pb_line_break_holder] -->            System.out.println(String.format(\"%.3f kg\", weight));      <!-- [et_pb_line_break_holder] -->            <!-- [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;]<\/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] -->VoltageRatioInput scale;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->\/\/Use your Offset Value<!-- [et_pb_line_break_holder] -->double offsetValue = INSERT VALUE HERE<!-- [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] -->    scale = new VoltageRatioInput();<!-- [et_pb_line_break_holder] -->   <!-- [et_pb_line_break_holder] -->    \/\/Open<!-- [et_pb_line_break_holder] -->    scale.open(1000);<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->  }catch(Exception e){<!-- [et_pb_line_break_holder] -->    \/\/Handle Exceptions<!-- [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] -->    \/\/Calculate Weight (kg)<!-- [et_pb_line_break_holder] -->    double weight = 4700 * (scale.getVoltageRatio() - offsetValue);<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->    \/\/Display Weight<!-- [et_pb_line_break_holder] -->    println(String.format(\"%.3f kg\", weight));<!-- [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] -->    \/\/Handle Exceptions<!-- [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;2_3&#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 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; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2>Write Code (Python)<\/h2>\n<p><!-- [et_pb_line_break_holder] --><pee>Not your programming language? <a class=\"ph-toggle-settings\">Set your preferences<\/a> so we can display relevant code examples.<\/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;]<\/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.VoltageRatioInput 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] -->scale = VoltageRatioInput()<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->#Open<!-- [et_pb_line_break_holder] -->scale.openWaitForAttachment(1000)<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->#Use your Offset Value<!-- [et_pb_line_break_holder] -->offsetValue = INSERT VALUE HERE<!-- [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] -->    #Calculate Weight (kg)<!-- [et_pb_line_break_holder] -->    weight = 4700 * (scale.getVoltageRatio() - offsetValue)<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->    #Display Weight<!-- [et_pb_line_break_holder] -->    print(\"%.3f kg\" % weight)<!-- [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;2_3&#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 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; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2>Write Code (C#)<\/h2>\n<p><!-- [et_pb_line_break_holder] --><pee>Not your programming language? <a class=\"ph-toggle-settings\">Set your preferences<\/a> so we can display relevant code examples.<\/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;]<\/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 PhidgetScale<!-- [et_pb_line_break_holder] -->{<!-- [et_pb_line_break_holder] -->    class Program<!-- [et_pb_line_break_holder] -->    {<!-- [et_pb_line_break_holder] -->        static void Main(string[] args)<!-- [et_pb_line_break_holder] -->        {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->            \/\/Create<!-- [et_pb_line_break_holder] -->            VoltageRatioInput scale = new VoltageRatioInput();<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->            \/\/Open <!-- [et_pb_line_break_holder] -->            scale.Open(1000);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->            \/\/Use your Offset Value<!-- [et_pb_line_break_holder] -->            double offsetValue = INSERT VALUE HERE<!-- [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] -->                \/\/Calculate Weight (kg)<!-- [et_pb_line_break_holder] -->                double weight = 4700 * (scale.VoltageRatio - offsetValue);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->                \/\/Display Weight<!-- [et_pb_line_break_holder] -->                System.Console.WriteLine(weight.ToString(\"F3\") + \" kg\");<!-- [et_pb_line_break_holder] --><!-- [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] -->  <\/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;2_3&#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 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; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2>Write Code (Swift)<\/h2>\n<p><!-- [et_pb_line_break_holder] --><pee>Not your programming language? <a class=\"ph-toggle-settings\">Set your preferences<\/a> so we can display relevant code examples.<\/pee>[\/et_pb_code][et_pb_code admin_label=&#8221;Instructions&#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;]<pee>The code below assumes you&#8217;ve created a single label and linked it to an IBOutlet named weightLabel<\/pee>[\/et_pb_code][et_pb_image src=&#8221;https:\/\/www.phidgets.com\/education\/wp-content\/uploads\/2021\/09\/scale_swift_weight.png&#8221; show_in_lightbox=&#8221;on&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; vertical_offset_tablet=&#8221;0&#8243; horizontal_offset_tablet=&#8221;0&#8243; width=&#8221;50%&#8221; 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;]<\/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 Phidgets 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 weightLabel: NSTextField!<!-- [et_pb_line_break_holder] -->    <!-- [et_pb_line_break_holder] -->    \/\/Create<!-- [et_pb_line_break_holder] -->    let scale = VoltageRatioInput()<!-- [et_pb_line_break_holder] -->    let offsetValue = INSERT VALUE HERE<!-- [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 _ = scale.voltageRatioChange.addHandler(scale_change)<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->            \/\/Open<!-- [et_pb_line_break_holder] -->            try scale.open()<!-- [et_pb_line_break_holder] -->            <!-- [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 scale_change(sender:VoltageRatioInput, voltageRatio: Double){<!-- [et_pb_line_break_holder] -->        DispatchQueue.main.async {<!-- [et_pb_line_break_holder] -->            \/\/Use your Phidget<!-- [et_pb_line_break_holder] -->            \/\/Calculate Weight (kg)<!-- [et_pb_line_break_holder] -->            let weight = 4700 * (voltageRatio - self.offsetValue)<!-- [et_pb_line_break_holder] -->            <!-- [et_pb_line_break_holder] -->            \/\/Display Weight<!-- [et_pb_line_break_holder] -->            self.weightLabel.stringValue = String(format:\"%.3f kg\",weight)<!-- [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 disabled_on=&#8221;off|off|off&#8221; admin_label=&#8221;Row&#8221; module_id=&#8221;run-program&#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;2_3&#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;Run Your Program&#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<h2>Run Your Program<\/h2>\n<p><!-- [et_pb_line_break_holder] --><pee>You should see 0.000 kg when nothing is on the scale. Try placing your phone on the scale to determine if the scale is accurate (you can easily find your phone\u2019s weight online).<\/pee><!-- [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] -->[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner disabled_on=&#8221;off|off|off&#8221; admin_label=&#8221;Row&#8221; module_id=&#8221;default-what&#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;2_3&#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;Why Is 4700 in My Code?&#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<h2>What is 4700?<\/h2>\n<p><!-- [et_pb_line_break_holder] --><pee>The value 4700 is used to translate the voltage readings from your scale into kilograms. The value is an <strong>estimate<\/strong> and can be refined through calibration in the Increasing Accuracy section. If you calibrate your scale, it will be much more accurate.<\/pee><!-- [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] -->[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner disabled_on=&#8221;off|off|off&#8221; admin_label=&#8221;Row&#8221; module_id=&#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;][et_pb_column_inner saved_specialty_column_type=&#8221;2_3&#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; module_id=&#8221;practice&#8221; _builder_version=&#8221;4.19.5&#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<h2>Practice<\/h2>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<ol><!-- [et_pb_line_break_holder] --><\/p>\n<li>Convert the scale output to grams instead of kg. (Hint: 1kg = 1000g)<\/li>\n<p><!-- [et_pb_line_break_holder] --><\/p>\n<li>Convert the scale output to pounds instead of kg. (Hint: 1kg = 2.205lbs)<\/li>\n<p><!-- [et_pb_line_break_holder] --><\/ol>\n<p><!-- [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] -->[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner disabled_on=&#8221;on|on|on&#8221; admin_label=&#8221;Row&#8221; module_id=&#8221;troubleshoot&#8221; _builder_version=&#8221;4.19.5&#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; disabled=&#8221;on&#8221; sticky_enabled=&#8221;0&#8243;][et_pb_column_inner saved_specialty_column_type=&#8221;2_3&#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.<\/li>\n<li>Stop running other programs that are using your Phidgets before running a program.<\/li>\n<\/ol>\n<p>If you are still having issues visit <a href=\"\/education\/learn\/advanced-troubleshooting\/\" target=\"_blank\" rel=\"noopener noreferrer\">Advanced Troubleshooting<\/a><\/p>\n<p>[\/et_pb_toggle][\/et_pb_column_inner][\/et_pb_row_inner][et_pb_row_inner admin_label=&#8221;Row&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221;][et_pb_column_inner saved_specialty_column_type=&#8221;2_3&#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-button-progress-ctn&#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;]<!-- Button Progress Container --><!-- [et_pb_line_break_holder] --><\/p>\n<div class=\"ph-button-progress-ctn\"><!-- [et_pb_line_break_holder] -->  <!-- Button Progress Previous --><!-- [et_pb_line_break_holder] -->  <a class=\"ph-button-progress-previous\" href=\"\/education\/learn\/projects\/scale-kit\/scale-offset\/\"><!-- [et_pb_line_break_holder] -->    Back to Get the Scale Offset<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->  <!-- Button Progress Next --><!-- [et_pb_line_break_holder] -->  <a class=\"ph-button-progress-next\" href=\"\/education\/learn\/projects\/scale-kit\/accuracy\/\"><!-- [et_pb_line_break_holder] -->    Next: Increasing Accuracy<!-- [et_pb_line_break_holder] -->  <\/a><!-- [et_pb_line_break_holder] --><\/div>\n<p>[\/et_pb_code][\/et_pb_column_inner][\/et_pb_row_inner][\/et_pb_column][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>package phidgetscale;\/\/Add Phidgets Libraryimport com.phidget22.*;public class PhidgetScale { public static void main(String[] args) throws Exception{ \/\/Create VoltageRatioInput scale = new VoltageRatioInput(); \/\/Open scale.open(1000); \/\/Use your Offset Value double offsetValue = INSERT VALUE HERE \/\/Use your Phidgets while(true){ \/\/Calculate Weight (kg) double weight = 4700 * (scale.getVoltageRatio() &#8211; offsetValue); \/\/Display Weight System.out.println(String.format(&#8220;%.3f kg&#8221;, weight)); Thread.sleep(250); } [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":6573,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"<!-- wp:paragraph -->\r\n<p>This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:<\/p>\r\n<!-- \/wp:paragraph --><!-- wp:quote -->\r\n<blockquote class=\"wp-block-quote\">\r\n<p>Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi\u00f1a coladas. (And gettin' caught in the rain.)<\/p>\r\n<\/blockquote>\r\n<!-- \/wp:quote --><!-- wp:paragraph -->\r\n<p>...or something like this:<\/p>\r\n<!-- \/wp:paragraph --><!-- wp:quote -->\r\n<blockquote class=\"wp-block-quote\">\r\n<p>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.<\/p>\r\n<\/blockquote>\r\n<!-- \/wp:quote --><!-- wp:paragraph -->\r\n<p>As a new WordPress user, you should go to <a href=\"https:\/\/www.phidgets.com\/education\/wp-admin\/\">your dashboard<\/a> to delete this page and create new pages for your content. Have fun!<\/p>\r\n<!-- \/wp:paragraph -->","_et_gb_content_width":"","footnotes":""},"class_list":["post-6674","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/6674","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=6674"}],"version-history":[{"count":19,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/6674\/revisions"}],"predecessor-version":[{"id":9440,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/6674\/revisions\/9440"}],"up":[{"embeddable":true,"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/pages\/6573"}],"wp:attachment":[{"href":"https:\/\/www.phidgets.com\/education\/wp-json\/wp\/v2\/media?parent=6674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}