private static void QueryDevice() { // Other system tests Console.WriteLine("Connecting..."); zeitgeber.Connect(); Console.Write("Connected to "); Console.WriteLine(zeitgeber.DeviceDescription); Console.WriteLine("Ping()"); zeitgeber.Ping(); //zeitgeber.SetLed(2, 1); Console.WriteLine("GetBatteryInfo()"); var battery = zeitgeber.GetBatteryInfo(); Console.WriteLine(String.Format("\tlevel: {0}%", battery.Level)); Console.WriteLine(String.Format("\tvoltage: {0}mV", battery.Voltage)); Console.WriteLine(String.Format("\tpower status: {0}", battery.PowerStatus)); Console.WriteLine(); Console.WriteLine("GetCpuInfo()"); var cpu = zeitgeber.GetCpuInfo(); Console.WriteLine(String.Format("\tsystick: {0}", cpu.systick)); Console.WriteLine(); Console.WriteLine("QueryDisplay()"); var display = zeitgeber.QueryDisplay(); Console.WriteLine(String.Format( "\tsize: {0}x{1}x{2}bpp ({3} bytes)", display.Width, display.Height, display.BitsPerPixel, display.Width * display.Height * (display.BitsPerPixel / 8) )); Console.WriteLine(); zeitgeber.SetDateTime(DateTime.Now); Console.WriteLine("GetDateTime()"); var dt = zeitgeber.GetDateTime(); Console.WriteLine(dt.ToString()); Console.WriteLine("Actual:"); Console.WriteLine(DateTime.Now.ToString()); Console.WriteLine(); }
private void button1_Click(object sender, EventArgs e) { zeitgeber.SetDateTime(DateTime.Now); }