This file contains 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
from time import sleep | |
import serial | |
import sys | |
from os.path import exists | |
def print_lines(lines): | |
for line in lines: | |
print(line.decode("utf-8", "ignore")) | |
def write(cmd): |
This file contains 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
''' | |
Based on Paul Sokolovsky's work on micropython mqtt client | |
Note MicroPython socket module supports file interface directly (read) | |
''' | |
import socket | |
import ustruct as struct | |
import time | |
class MQTTClient: |
This file contains 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
# Copyright (c) 2012-2014 Roger Light <[email protected]> | |
# | |
# This is a stripped down version of paho.mqtt intended for micropython | |
# All rights reserved. This program and the accompanying materials | |
# are made available under the terms of the Eclipse Public License v1.0 | |
# and Eclipse Distribution License v1.0 which accompany this distribution. | |
# | |
# The Eclipse Public License is available at | |
# http://www.eclipse.org/legal/epl-v10.html | |
# and the Eclipse Distribution License is available at |
This file contains 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
# Originally from https://github.com/guyc/py-gaugette/blob/master/gaugette/font5x8.py | |
# Contains ASCII 32 (space) through ASCII 90 (Z) | |
cols = 5 | |
rows = 8 | |
bytes = [ | |
0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x5F, 0x00, 0x00, | |
0x00, 0x07, 0x00, 0x07, 0x00, | |
0x14, 0x7F, 0x14, 0x7F, 0x14, |