sim28-gps-device

antoniorrg/sim28-gps-module/sim28-gps-device

No description
sim28-gps-device
@/sim28-gps-device
TXport
RXport
UPDpulse
sim28-gps-device
OUT
TX
RX
UPD
OUT@/sim28-gps-device
To use the node in your project you should have the antoniorrg/sim28-gps-module library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD require "https://github.com/PaulStoffregen/SoftwareSerial"
#pragma XOD require "https://github.com/mikalhart/TinyGPS"

#include <SoftwareSerial.h>
#include <TinyGPS.h>

node {

        meta {
        using Type = SoftwareSerial*;
    }
    
    static_assert(isValidDigitalPort(constant_input_RX), "must be a valid digital port");
    static_assert(isValidDigitalPort(constant_input_TX), "must be a valid digital port");

    SoftwareSerial ss = SoftwareSerial(constant_input_RX, constant_input_TX);

    
    // Internal state variables defined at this level persists across evaluations
    Number foo;
    uint8_t bar = 5;

    void evaluate(Context ctx) {
        bar += 42;

        if (isSettingUp()) {
            // This run once
            foo = (Number)(bar + 1);
        }

       if (!isInputDirty<input_UPD>(ctx))
       return;
        
     ss.begin(9600);                 // the SoftSerial baud rate
        
        
        emitValue<output_OUT>(ctx, &ss);
        
    }
}