Commit 7bb0f7b0 authored by Damien George's avatar Damien George
Browse files

drivers: Add "from micropython import const" when const is used.

Following best-practice use of the const feature, to make it compatible
with Python.
parent 561844f3
# MicroPython SSD1306 OLED driver, I2C and SPI interfaces
from micropython import const
import time
import framebuf
......
"""NRF24L01 driver for Micro Python
"""
from micropython import const
import pyb
# nRF24L01+ registers
......
......@@ -21,6 +21,7 @@ Example usage on ESP8266:
"""
from micropython import const
import time
......
# DS18x20 temperature sensor driver for MicroPython.
# MIT license; Copyright (c) 2016 Damien P. George
from micropython import const
_CONVERT = const(0x44)
_RD_SCRATCH = const(0xbe)
_WR_SCRATCH = const(0x4e)
......
# 1-Wire driver for MicroPython on ESP8266
# MIT license; Copyright (c) 2016 Damien P. George
from micropython import const
import _onewire as _ow
class OneWireError(Exception):
......
......@@ -14,6 +14,7 @@ See:
STM32Cube_FW_F4_V1.1.0/Projects/STM32F4-Discovery/Demonstrations/Src/main.c
"""
from micropython import const
from pyb import Pin
from pyb import SPI
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment