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
""" | |
This is a MicroPython driver for the Dallas (Maxim) DS1621 digital temperature sensor. | |
The DS1621 is an I2C device, and is able to provide digital temperature data with a resolution of 9 bits, resulting in a | |
granularity of 0.5 degrees Celsius. | |
Additionally, the DS1621 is a relatively simple device; as such, the I2C command set is rather simple. The simplicity is | |
a great factor for utilizing this device (and driver) as a simple example for use of I2C on MicroPython; the basic read, | |
write, and other functionality are demonstrated. Additionally, some simple data manipulation methods are demonstrated. | |
""" |
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
# Author: Paul Cunnane 2016 | |
# | |
# This module borrows heavily from the Adafruit BME280 Python library | |
# and the Adafruit GPIO/I2C library. Original copyright notices are reproduced | |
# below. | |
# | |
# Those libraries were written for the Raspberry Pi. This modification is | |
# intended for the MicroPython and WiPy boards. | |
# | |
# |
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
# | |
# main.py | |
# | |
# Example for MicroPython | |
# | |
from machine import Pin, RTC, PWM, Signal, I2C | |
# from machine import I2C | |
# from machine import SPI |
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
# This file is executed on every boot (including wake-boot from deepsleep) | |
import esp | |
import gc | |
import webrepl | |
import machine | |
import network | |
# import socket | |
# Disable debug output |
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
# This file is executed on every boot (including wake-boot from deepsleep) | |
# Import any necessary modules for early in the system boot process | |
import esp | |
import gc | |
import webrepl | |
import machine | |
import network | |
# import socket | |
import uos |
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
import network | |
import utime | |
import ntptime | |
import onewire | |
import ds18x20 | |
import socket | |
import os | |
import sys | |
import esp | |
import machine |
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
import machine | |
def print_all_reset_causes(): | |
print("\n +------------------------+") | |
print(" | KNOWN RESET CAUSES |") | |
print(" +------------------------+\n") | |
print(" PWRON_RESET: %d" % machine.PWRON_RESET) | |
print(" WDT_RESET: %d" % machine.WDT_RESET) | |
print(" SOFT_RESET: %d" % machine.SOFT_RESET) | |
print(" DEEPSLEEP_RESET: %d" % machine.DEEPSLEEP_RESET) |
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
import utime | |
#import machine | |
from machine import RTC | |
try: | |
import usocket as socket | |
except: | |
import socket | |
try: | |
import ustruct as struct |
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
#!/usr/bin/env python3 | |
import locale | |
locale.setlocale(locale.LC_ALL, '') | |
import curses | |
from curses import wrapper | |
import time | |
import numpy as np | |
import pigpio |
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
#!/usr/bin/env python3 | |
# Copyright 2017 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |