Skip to content

Instantly share code, notes, and snippets.

View janpom's full-sized avatar

Jan Pomikálek janpom

  • Brno, Czech Republic
View GitHub Profile
@janpom
janpom / metr2nmea.py
Created October 13, 2021 21:37
Converts Metr Pro JSON log to NMEA
import datetime
import json
import sys
import pynmea2
def gps_deg_to_degmin(deg):
deg_only = int(deg)
return '%d%.5f' % (deg_only, (deg - deg_only) * 60)
@janpom
janpom / davega_simple_vertical_screen.cpp
Created June 13, 2019 07:12
DAVEga: put motor/FET temp on vertical screen instead of battery % and total distance
/*
Copyright 2018 Jan Pomikalek <jan.pomikalek@gmail.com>
This file is part of the DAVEga firmware.
DAVEga firmware is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
// ArduinoISP
// Copyright (c) 2008-2011 Randall Bohn
// If you require a license, see
// http://www.opensource.org/licenses/bsd-license.php
//
// This sketch turns the Arduino into a AVRISP using the following Arduino pins:
//
// Pin 10 is used to reset the target microcontroller.
//
// By default, the hardware SPI pins MISO, MOSI and SCK are used to communicate
//#define DEV_MODE 1
#include <TFT_22_ILI9225.h>
#include <SoftwareSerial.h>
#include "tft_util.h"
#define TFT_RST 12
#define TFT_RS 9
#define TFT_CS 10 // SS
#define TFT_SDI 11 // MOSI
#include "datatypes.h"
#include "crc.h"
#define PACKET_LENGTH_IDENTIFICATION_BYTE_SHORT 2
#define PACKET_LENGTH_IDENTIFICATION_BYTE_LONG 3
#define PACKET_TERMINATION_BYTE 3
#define PACKET_PAYLOAD_MAX_LENGTH 512
// Start byte + packet length bytes + payload + 2 bytes (CRC) + termination byte