Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/apds9960/apds9960/device.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from time import sleep_ms

from apds9960.const import *
from apds9960.exceptions import *

from time import sleep_ms


class APDS9960(object):
class GestureData:
Expand Down
3 changes: 1 addition & 2 deletions lib/apds9960/examples/ambient_light.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from time import sleep

from machine import I2C

from apds9960 import uAPDS9960 as APDS9960
from machine import I2C

i2c = I2C(1)

Expand Down
13 changes: 6 additions & 7 deletions lib/apds9960/examples/gesture.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from time import sleep

from machine import I2C

from apds9960 import uAPDS9960 as APDS9960
from apds9960.const import (
APDS9960_DIR_NONE,
APDS9960_DIR_DOWN,
APDS9960_DIR_FAR,
APDS9960_DIR_LEFT,
APDS9960_DIR_NEAR,
APDS9960_DIR_NONE,
APDS9960_DIR_RIGHT,
APDS9960_DIR_UP,
APDS9960_DIR_DOWN,
APDS9960_DIR_NEAR,
APDS9960_DIR_FAR,
)
from apds9960 import uAPDS9960 as APDS9960
from machine import I2C

i2c = I2C(1)

Expand Down
3 changes: 1 addition & 2 deletions lib/apds9960/examples/proximity.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from time import sleep

from machine import I2C

from apds9960 import uAPDS9960 as APDS9960
from machine import I2C

i2c = I2C(1)

Expand Down
8 changes: 4 additions & 4 deletions lib/bq27441/bq27441/device.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from bq27441.const import *
from bq27441.exceptions import *

import struct
from time import sleep_ms, ticks_ms

from machine import Pin

import struct
from bq27441.const import *
from bq27441.exceptions import *


# Parameters for the current() function, to specify which current to read
Expand Down
3 changes: 1 addition & 2 deletions lib/bq27441/examples/fuel_gauge.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from time import sleep

from machine import I2C

from bq27441 import BQ27441
from machine import I2C

i2c = I2C(1)

Expand Down
3 changes: 2 additions & 1 deletion lib/daplink_flash/examples/config_zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
- CLEAR_CONFIG (0x32): erase the entire 1 KB zone
"""

from machine import I2C
from time import sleep_ms

from machine import I2C

i2c = I2C(1)
addr = 0x3B
passed = 0
Expand Down
3 changes: 2 additions & 1 deletion lib/daplink_flash/examples/erase_flash.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Erase all data from the flash memory."""

from machine import I2C
from time import sleep_ms

from daplink_flash import DaplinkFlash
from machine import I2C

i2c = I2C(1)
flash = DaplinkFlash(i2c)
Expand Down
2 changes: 1 addition & 1 deletion lib/daplink_flash/examples/flash_info.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Display DAPLink Flash bridge status and filename."""

from machine import I2C
from daplink_flash import DaplinkFlash
from machine import I2C

i2c = I2C(1)
flash = DaplinkFlash(i2c)
Expand Down
2 changes: 1 addition & 1 deletion lib/daplink_flash/examples/read_file.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Read and display the current file stored on flash."""

from machine import I2C
from daplink_flash import DaplinkFlash
from machine import I2C

i2c = I2C(1)
flash = DaplinkFlash(i2c)
Expand Down
3 changes: 2 additions & 1 deletion lib/daplink_flash/examples/sensor_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
for each column.
"""

from machine import I2C
from time import sleep_ms

from daplink_flash import DaplinkFlash
from machine import I2C

# --- Configuration ---
NUM_ROWS = 200
Expand Down
3 changes: 2 additions & 1 deletion lib/daplink_flash/examples/write_csv.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Write CSV data to flash via DAPLink bridge."""

from machine import I2C
from time import sleep_ms

from daplink_flash import DaplinkFlash
from machine import I2C

i2c = I2C(1)
flash = DaplinkFlash(i2c)
Expand Down
5 changes: 3 additions & 2 deletions lib/hts221/examples/humidity.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from machine import I2C
from hts221 import HTS221
from time import sleep_ms

import pyb
from hts221 import HTS221
from machine import I2C

i2c = I2C(1)

Expand Down
3 changes: 2 additions & 1 deletion lib/hts221/hts221/device.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from machine import I2C
from time import sleep_ms

from machine import I2C

from hts221.const import *


Expand Down
3 changes: 2 additions & 1 deletion lib/ism330dl/examples/basic_read.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from machine import I2C
from time import sleep_ms

from ism330dl import ISM330DL
from machine import I2C

i2c = I2C(1)

Expand Down
3 changes: 2 additions & 1 deletion lib/ism330dl/examples/motion_orientation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from machine import I2C
from time import sleep_ms

from ism330dl import ISM330DL
from machine import I2C

i2c = I2C(1)

Expand Down
3 changes: 2 additions & 1 deletion lib/ism330dl/examples/static_orientation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from machine import I2C
from time import sleep_ms

from ism330dl import ISM330DL
from machine import I2C

i2c = I2C(1)

Expand Down
4 changes: 2 additions & 2 deletions lib/ism330dl/ism330dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from ism330dl.device import ISM330DL
from ism330dl.exceptions import (
ISM330DLError,
ISM330DLNotFound,
ISM330DLConfigError,
ISM330DLError,
ISM330DLIOError,
ISM330DLNotFound,
)

__all__ = [
Expand Down
5 changes: 3 additions & 2 deletions lib/lis2mdl/examples/magnet_compass.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Example of heading reading with direction label
from time import sleep_ms
from machine import I2C
from lis2mdl.device import LIS2MDL

from lis2mdl.const import *
from lis2mdl.device import LIS2MDL
from machine import I2C

i2c = I2C(1)
mag = LIS2MDL(i2c)
Expand Down
5 changes: 3 additions & 2 deletions lib/lis2mdl/examples/magnet_fieldForce.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Example of heading reading with direction label
from time import sleep_ms
from machine import I2C
from lis2mdl.device import LIS2MDL

from lis2mdl.const import *
from lis2mdl.device import LIS2MDL
from machine import I2C

i2c = I2C(1)
mag = LIS2MDL(i2c)
Expand Down
7 changes: 4 additions & 3 deletions lib/lis2mdl/examples/magnet_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import math
from time import sleep_ms
from machine import I2C
from lis2mdl.device import LIS2MDL

from lis2mdl.const import *
import math
from lis2mdl.device import LIS2MDL
from machine import I2C

# Définition des constantes pour remplacer les valeurs magiques
MAGNETIC_FIELD_MIN = 5.0
Expand Down
6 changes: 4 additions & 2 deletions lib/lis2mdl/lis2mdl/device.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# device.py
# This driver is for the LIS2MDL magnetometer sensor. It provides methods for initialization, calibration, and reading magnetic field data.

import math
from time import sleep_ms

from machine import I2C

from lis2mdl.const import *
from time import sleep_ms
import math


class LIS2MDL(object):
Expand Down
2 changes: 1 addition & 1 deletion lib/mcp23009e/examples/buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""

from time import sleep
from machine import I2C, Pin

from machine import I2C, Pin
from mcp23009e import MCP23009E
from mcp23009e.const import *

Expand Down
3 changes: 2 additions & 1 deletion lib/mcp23009e/examples/i2c_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Utile pour trouver l'adresse correcte du MCP23009E
"""
from time import sleep
from machine import I2C,Pin

from machine import I2C, Pin

reset = Pin("RST_EXPANDER")
reset.init(Pin.OUT)
Expand Down
2 changes: 1 addition & 1 deletion lib/mcp23009e/examples/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""

from time import sleep
from machine import I2C, Pin

from machine import I2C, Pin
from mcp23009e import MCP23009E
from mcp23009e.const import *

Expand Down
2 changes: 1 addition & 1 deletion lib/mcp23009e/examples/test_interrupts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""

from time import sleep
from machine import I2C, Pin

from machine import I2C, Pin
from mcp23009e import MCP23009E
from mcp23009e.const import *

Expand Down
2 changes: 1 addition & 1 deletion lib/mcp23009e/examples/test_led_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"""

from time import sleep
from machine import I2C, Pin

from machine import I2C, Pin
from mcp23009e import MCP23009E, MCP23009ActiveLowPin
from mcp23009e.const import *

Expand Down
2 changes: 1 addition & 1 deletion lib/mcp23009e/examples/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Ce script teste la configuration des GPIO en sortie et le contrôle de leur niveau
"""
import time
from machine import I2C, Pin

from machine import I2C, Pin
from mcp23009e import MCP23009E, MCP23009Pin
from mcp23009e.const import *

Expand Down
2 changes: 1 addition & 1 deletion lib/mcp23009e/examples/test_output_active_low.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"""

from time import sleep
from machine import I2C, Pin

from machine import I2C, Pin
from mcp23009e import MCP23009E, MCP23009Pin
from mcp23009e.const import *

Expand Down
2 changes: 1 addition & 1 deletion lib/mcp23009e/examples/test_pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""

from time import sleep
from machine import I2C, Pin

from machine import I2C, Pin
from mcp23009e import MCP23009E, MCP23009Pin
from mcp23009e.const import *

Expand Down
2 changes: 1 addition & 1 deletion lib/mcp23009e/examples/test_pin_irq.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""

from time import sleep
from machine import I2C, Pin

from machine import I2C, Pin
from mcp23009e import MCP23009E, MCP23009Pin
from mcp23009e.const import *

Expand Down
2 changes: 1 addition & 1 deletion lib/mcp23009e/mcp23009e/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from mcp23009e.active_low_pin import MCP23009ActiveLowPin
from mcp23009e.device import MCP23009E
from mcp23009e.pin import MCP23009Pin
from mcp23009e.active_low_pin import MCP23009ActiveLowPin

__all__ = [
"MCP23009E",
Expand Down
3 changes: 2 additions & 1 deletion lib/mcp23009e/mcp23009e/device.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from machine import I2C, Pin
from time import sleep_ms

from machine import I2C, Pin

from mcp23009e.const import *


def _set_bit(reg, bit, value):
"""Modifie un bit spécifique dans un registre"""
if value == 0:
Expand Down
1 change: 1 addition & 0 deletions lib/mcp23009e/mcp23009e/pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

from machine import Pin as MachinePin

from mcp23009e.const import *


Expand Down
1 change: 0 additions & 1 deletion lib/ssd1327/examples/bitmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# .....#####...... 00 00 0F FF FF 00 00 00

import ssd1327

from machine import SPI, Pin

# Setup display on SPI bus
Expand Down
3 changes: 2 additions & 1 deletion lib/ssd1327/examples/framebuf_lines.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ssd1327
from time import sleep

import ssd1327
from machine import SPI, Pin

# Setup display on SPI bus
Expand Down
3 changes: 2 additions & 1 deletion lib/ssd1327/examples/framebuf_pixels.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ssd1327
from time import sleep

import ssd1327
from machine import SPI, Pin

# Setup display on SPI bus
Expand Down
Loading
Loading