Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
# MicroPython SSD1306 OLED driver, I2C and SPI interfaces # MicroPython SSD1306 OLED driver, I2C and SPI interfaces
from micropython import const
import time import time
import framebuf import framebuf
......
"""NRF24L01 driver for Micro Python """NRF24L01 driver for Micro Python
""" """
from micropython import const
import pyb import pyb
# nRF24L01+ registers # nRF24L01+ registers
......
...@@ -21,6 +21,7 @@ Example usage on ESP8266: ...@@ -21,6 +21,7 @@ Example usage on ESP8266:
""" """
from micropython import const
import time import time
......
# DS18x20 temperature sensor driver for MicroPython. # DS18x20 temperature sensor driver for MicroPython.
# MIT license; Copyright (c) 2016 Damien P. George # MIT license; Copyright (c) 2016 Damien P. George
from micropython import const
_CONVERT = const(0x44) _CONVERT = const(0x44)
_RD_SCRATCH = const(0xbe) _RD_SCRATCH = const(0xbe)
_WR_SCRATCH = const(0x4e) _WR_SCRATCH = const(0x4e)
......
# 1-Wire driver for MicroPython on ESP8266 # 1-Wire driver for MicroPython on ESP8266
# MIT license; Copyright (c) 2016 Damien P. George # MIT license; Copyright (c) 2016 Damien P. George
from micropython import const
import _onewire as _ow import _onewire as _ow
class OneWireError(Exception): class OneWireError(Exception):
......
...@@ -14,6 +14,7 @@ See: ...@@ -14,6 +14,7 @@ See:
STM32Cube_FW_F4_V1.1.0/Projects/STM32F4-Discovery/Demonstrations/Src/main.c STM32Cube_FW_F4_V1.1.0/Projects/STM32F4-Discovery/Demonstrations/Src/main.c
""" """
from micropython import const
from pyb import Pin from pyb import Pin
from pyb import SPI from pyb import SPI
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment