DockerPi MotorDriverboard SKU: EP-0107: Difference between revisions

From 52Pi Wiki
Jump to navigation Jump to search
(Blanked the page)
Tag: Blanking
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
==DockerPi MotorDriverboard==
[[File:Dockerpi-relay-m.png| 320px | right]]


==Description==
gps_stream(&gps_data, WATCH_ENABLE | WATCH_JSON, NULL);
while (1) {
    /* wait for 2 seconds to receive data */
    if (gps_waiting (&gps_data, 2000000)) {
        /* read data */
        if ((rc = gps_read(&gps_data)) == -1) {
            printf("error occured reading gps data. code: %d, reason: %s\n", rc, gps_errstr(rc));
        } else {
            /* Display data from the GPS receiver. */
            if ((gps_data.status == STATUS_FIX) &&
                (gps_data.fix.mode == MODE_2D || gps_data.fix.mode == MODE_3D) &&
                !isnan(gps_data.fix.latitude) &&
                !isnan(gps_data.fix.longitude)) {
                    //gettimeofday(&tv, NULL); EDIT: tv.tv_sec isn't actually the timestamp!
                    printf("latitude: %f, longitude: %f, speed: %f, timestamp: %lf\n", gps_data.fix.latitude, gps_data.fix.longitude, gps_data.fix.speed, gps_data.fix.time); //EDIT: Replaced tv.tv_sec with gps_data.fix.time
            } else {
                printf("no GPS data available\n");
            }
        }
    }
    sleep(3);
}
/* When you are done... */
gps_stream(&gps_data, WATCH_DISABLE, NULL);
gps_close (&gps_data);
==Features==
==Spicifications==
==Package Includes==
==Gallery==
{|
|[[File:Dockerpi-relay-m.png| 320px | left ]]
|[[File:Dockerpi-relay-m.png| 320px | none ]]
|[[File:Dockerpi-relay-m.png| 320px | none ]]
|}
==How to use==
==FAQ==
==Keywords==
==Tutorial Video==

Latest revision as of 18:57, 2 July 2019