/*__________________________________________ * * G E N E R A L C L A S S Created 7/30/2014 * * _________________________________________ * * Holds general declarations for entire project * */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; //******************************************************************* using Windows.Devices.Bluetooth.Rfcomm; //add these using Windows.Networking.Sockets; using Windows.Storage.Streams; using Windows.Devices.Enumeration; using Windows.UI.Popups; using System.Globalization; //******************************************************************* namespace _2__NXT_BT_Basic_Moving { internal static class General { #region BlueTooth and Binary reader definitions internal static RfcommDeviceService rfcommservice; internal static StreamSocket socket; internal static DataWriter myWriter = null; internal static DataReader myReader = null; #endregion #region Initial byte arrays to control motors and get battery level. See documentation in the Lego BT API folder //initial motor settings: forward at 75% Byte 4 = port # (01 = B, 02=C) Byte 5 = speed 0x32 = 50% forward 0xCF = 50% backwards 4B = 75% forward internal static Byte[] LeftMotor = { 0x0C, 0x00, 0x80, 0x04, 0x02, 0x32, 0x05, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00 }; internal static Byte[] RightMotor = { 0x0C, 0x00, 0x80, 0x04, 0x01, 0x32, 0x05, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00 }; //--- for reading responses FROM robot. 0x0B = getbatteryvoltage internal static Byte[] ReadBattery = { 0x02, 0x00, 0x00, 0x0B }; #endregion } }