コード例 #1
0
ファイル: EmisoraUSB.cs プロジェクト: rajeper/ikarus-osd
        public float ReadBatteryLevel()
        {
            byte[] buff = ReadRAW(0xfb,sizeof(float));
            int    i    = 0;
            float  v    = USBXpress.tofloat(buff,ref i);

            return(v);
        }
コード例 #2
0
        public float[] ReadADCs()
        {
            byte[]   buffer = Read(Comandos.ADC_VALUES, 0, 0, 8 * 4);
            float [] adcs   = new float[buffer.Length / 4];
            int      i      = 0;

            for (int j = 0; j < adcs.Length; j++)
            {
                adcs[j] = USBXpress.tofloat(buffer, ref i);
            }
            return(adcs);
        }
コード例 #3
0
        public WayPoint ReadWpt(int id)
        {
            WayPoint wpt = null;

            wpt = new WayPoint();
            int i = 0;

            byte[] buffer = Read(Comandos.Ruta, (byte)id, 0, 32);
            wpt.name      = USBXpress.tostring(buffer, ref i, 20);
            wpt.Longitude = USBXpress.tofloat(buffer, ref i);
            wpt.Latitude  = USBXpress.tofloat(buffer, ref i);
            wpt.Altitude  = USBXpress.tofloat(buffer, ref i);

            return(wpt);
        }