Skip to content

Instantly share code, notes, and snippets.

@sash13
Created February 9, 2016 17:12
Show Gist options
  • Select an option

  • Save sash13/0a88ef9be2ffbc60eac8 to your computer and use it in GitHub Desktop.

Select an option

Save sash13/0a88ef9be2ffbc60eac8 to your computer and use it in GitHub Desktop.
NavSpark-mini example from forum
uint8_t led = 13;
void setup() {
//GnssConf.init();
// put your setup code here, to run once:
pinMode(led, OUTPUT);
Serial1.config(STGNSS_UART_8BITS_WORD_LENGTH, STGNSS_UART_1STOP_BITS, STGNSS_UART_NOPARITY);
Serial1.begin(115200);
}
void loop()
{
// put your main code here, to run repeatedly:
}
void task_called_after_GNSS_update(void)
{
static uint8_t val = HIGH;
char buf[32];
if (val == HIGH) {
digitalWrite(led, HIGH);
sprintf(buf, "Hello world (GPIO%02d high)\r\n", led);
Serial1.print(buf);
val = LOW;
}
else if (val == LOW) {
digitalWrite(led, LOW);
sprintf(buf, "Hello world (GPIO%02d low)\r\n", led);
Serial1.print(buf);
val = HIGH;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment