using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RoBoIO_DotNet;
using System.Threading;
namespace GPS_RoBoard
{
class Program
{
public static String d = "";
static void Main(string[] args)
{
RoBoIO.roboio_SetRBVer(RoBoIO.RB_110);
while (true)
{
for (int i = 1; i <= 27; i++) citiregps();
Console.WriteLine();
d = "";
Thread.Sleep(100);
}
}
static void citiregps()
{
if (RoBoIO.i2c_Initialize(RoBoIO.I2CIRQ_DISABLE))
{
RoBoIO.i2c0_SetSpeed(RoBoIO.I2CMODE_AUTO, 400000);
RoBoIO.i2c0master_StartN(0x4E, RoBoIO.I2C_READ,1);
Console.Write((char)RoBoIO.i2c0master_ReadN());
}
else { Console.WriteLine("Nu merge i2c " + RoBoIO.roboio_GetErrMsg()); }
RoBoIO.i2c_Close();
}
}
}
#include <Wire>
#include "LB_GPS.h"
void setup(){
//setup for Serial port
Serial.begin(9600);
Wire.begin(0x4E);
Wire.onRequest(trimitere);
// GPS warm-up time
delay(1000);
// configure NMEA sentences to show only GGA sentence
// it is anyway the one coming by default
GPS.setSentences(GPGGA);
delay(100);
// command initializing the GPS, by default it is preconfigured to be the
// weather station at central Malmo, Sweden, April 8th, 2009, 6:56AM
GPS.init();
// done!
Serial.println(" done!");
}
int i=0;
void loop(){
char v[6];
// Part 1: print a GPGGA sentence raw as it comes from the GPS
// print the raw data string arriving from the GPS
GPS.getRaw(100);
GPS.getLocation();
GPS.getSpeed();
//fmtDouble(GPS.speed, 2, v,7);
//for(int i=0;i<=3;i++)GPS.coordinates+=v[i];
//for(int i=0;i<=23;i++)Serial.print(GPS.coordinates[i]);
//Serial.println();
GPS.coordinates[24]=v[0];
GPS.coordinates[25]=v[1];
GPS.coordinates[26]=v[2];
GPS.coordinates[27]=v[3];
//for(int i=0;i<=27;i++)Serial.print(GPS.coordinates[i]);
//Serial.println();
}
void trimitere()
{
if(i==27)i=0;
Wire.send(GPS.coordinates[i]);
Serial.print(GPS.coordinates[i]);
i++;
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RoBoIO_DotNet;
using System.Threading;
namespace GPS_RoBoard
{
class Program
{
public static String d = "";
static void Main(string[] args)
{
RoBoIO.roboio_SetRBVer(RoBoIO.RB_110);
if (RoBoIO.i2c_Initialize(RoBoIO.I2CIRQ_DISABLE))
{
RoBoIO.i2c0_SetSpeed(RoBoIO.I2CMODE_AUTO, 400000);
while (true)
{
for (int i = 1; i <= 27; i++) citiregps();
Console.WriteLine();
d = "";
Thread.Sleep(100);
}
}
RoBoIO.i2c_Close();
}
static void citiregps()
{
RoBoIO.i2c0master_StartN(0x4E, RoBoIO.I2C_READ,1);
Console.Write((char)RoBoIO.i2c0master_ReadN());
}
}
}