This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| :: configuration | |
| SET CC=sdcc | |
| SET CFLAGS=-mstm8 | |
| SET INCLUDEPATH=C:/st_toolset/STM8S_StdPeriph_Lib/Libraries/STM8S_StdPeriph_Driver/inc | |
| :: mcu type defined in stm8s.h file | |
| SET DEFINES=STM8S103 | |
| SET SOURCE=leds | |
| SET OUTPUT_DIR=build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # CFG-RATE (0x06,0x08) packet (without header 0xB5,0x62) | |
| # payload length - 6 (little endian format), update rate 200ms, cycles - 1, reference - UTC (0) | |
| packet = [0x06,0x08, 0x06,0x00, 0x00,0xC8, 0x00,0x01, 0x00,0x00] | |
| CK_A,CK_B = 0, 0 | |
| for i in range(len(packet)): | |
| CK_A = CK_A + packet[i] | |
| CK_B = CK_B + CK_A | |
| # ensure unsigned byte range |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Script connects to uBlox 6M GPS receiver through serial interface, | |
| # reads received NMEA messages, parses and verifies | |
| # them and finally prints parsed information to console (logfile). | |
| # | |
| # NOTE: change below configuration based on your device parameters | |
| # configuration | |
| port = "COM15" | |
| baud = 9600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def chksum(inp): # GPS message checksum verification | |
| if not inp.startswith("$"): return False | |
| if not inp[-3:].startswith("*"): return False | |
| payload = inp[1:-3] | |
| checksum = 0 | |
| for i in xrange(len(payload)): | |
| checksum = checksum ^ ord(payload[i]) | |
| return ("%02X" % checksum) == inp[-2:] | |
| # do simple test |
NewerOlder