forked from nricciar/usb_scale
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.cs
More file actions
37 lines (34 loc) · 766 Bytes
/
Example.cs
File metadata and controls
37 lines (34 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* * Created by SharpDevelop.
* * User: nricciar
* * Date: 10/7/2010
* * Time: 11:53 AM
* *
* * To change this template use Tools | Options | Coding | Edit Standard Headers.
* */
using System;
using System.Threading;
using HidLibrary;
using ScaleInterface;
namespace ScaleReader
{
class Program
{
public static void Main(string[] args)
{
decimal? weight;
bool? isStable;
USBScale s = new USBScale();
s.Connect();
if (s.IsConnected)
{
s.GetWeight(out weight, out isStable);
s.DebugScaleData();
s.Disconnect();
Console.WriteLine("Weight: {0:0.00} LBS", weight);
} else {
Console.WriteLine("No Scale Connected.");
}
}
}
}