diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/adc_read_ext_channel.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/adc_read_ext_channel.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/adc_read_ext_channel.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/adc_read_ext_channel.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/adc_read_int_channel.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/adc_read_int_channel.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/adc_read_int_channel.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/adc_read_int_channel.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/can.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/can.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/can.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/can.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/cpufreq_scaling.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/cpufreq_scaling.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/cpufreq_scaling.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/cpufreq_scaling.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/i2c_scanner.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/i2c_scanner.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/i2c_scanner.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/i2c_scanner.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/led_control.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/led_control.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/led_control.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/led_control.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/pin_control.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/pin_control.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/pin_control.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/pin_control.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/pwm_control.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/pwm_control.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/pwm_control.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/pwm_control.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/rtc.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/rtc.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/rtc.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/rtc.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/spi_control.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/spi_control.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/spi_control.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/spi_control.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/timer_control.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/timer_control.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/timer_control.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/timer_control.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/uart_control.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/uart_control.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/uart_control.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/uart_control.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/usb_hid.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/usb_hid.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/usb_hid.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/usb_hid.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/usb_vcp.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/usb_vcp.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/usb_vcp.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/usb_vcp.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/vsync_gpio_output.py b/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/vsync_gpio_output.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/00-Board-Control/vsync_gpio_output.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/vsync_gpio_output.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/01-Display/display.py b/scripts/examples/50-Arduino-Boards/Giga-H7/51-Display/display.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/01-Display/display.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/51-Display/display.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/02-Audio/audio_fft.py b/scripts/examples/50-Arduino-Boards/Giga-H7/52-Audio/audio_fft.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/02-Audio/audio_fft.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/52-Audio/audio_fft.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/02-Audio/micro_speech.py b/scripts/examples/50-Arduino-Boards/Giga-H7/52-Audio/micro_speech.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/02-Audio/micro_speech.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/52-Audio/micro_speech.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/05-Low-Power/deep_sleep.py b/scripts/examples/50-Arduino-Boards/Giga-H7/53-Low-Power/deep_sleep.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/05-Low-Power/deep_sleep.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/53-Low-Power/deep_sleep.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/05-Low-Power/extint_wakeup.py b/scripts/examples/50-Arduino-Boards/Giga-H7/53-Low-Power/extint_wakeup.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/05-Low-Power/extint_wakeup.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/53-Low-Power/extint_wakeup.py diff --git a/scripts/examples/50-Arduino-Boards/Giga-H7/05-Low-Power/stop_mode.py b/scripts/examples/50-Arduino-Boards/Giga-H7/53-Low-Power/stop_mode.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Giga-H7/05-Low-Power/stop_mode.py rename to scripts/examples/50-Arduino-Boards/Giga-H7/53-Low-Power/stop_mode.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/03-Bluetooth/ble_blinky.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/10-Bluetooth/ble_blinky.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/03-Bluetooth/ble_blinky.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/10-Bluetooth/ble_blinky.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/03-Bluetooth/ble_scan.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/10-Bluetooth/ble_scan.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/03-Bluetooth/ble_scan.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/10-Bluetooth/ble_scan.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/03-Bluetooth/ble_temperature.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/10-Bluetooth/ble_temperature.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/03-Bluetooth/ble_temperature.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/10-Bluetooth/ble_temperature.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/00-Board-Control/i2c_scanner.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/50-Board-Control/i2c_scanner.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/00-Board-Control/i2c_scanner.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/50-Board-Control/i2c_scanner.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/apds9960/ambient.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/apds9960/ambient.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/apds9960/ambient.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/apds9960/ambient.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/apds9960/gesture.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/apds9960/gesture.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/apds9960/gesture.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/apds9960/gesture.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/apds9960/proximity.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/apds9960/proximity.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/apds9960/proximity.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/apds9960/proximity.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/hts221.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/hts221.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/hts221.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/hts221.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/imu.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/imu.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/imu.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/imu.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/lps22.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/lps22.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/lps22.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/51-Sensors/lps22.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/02-Audio/audio_fft.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/52-Audio/audio_fft.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/02-Audio/audio_fft.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/52-Audio/audio_fft.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/04-Thermal/thermal_camera.py b/scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/53-Thermal/thermal_camera.py similarity index 100% rename from scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/04-Thermal/thermal_camera.py rename to scripts/examples/50-Arduino-Boards/Nano-33-BLE-Sense/53-Thermal/thermal_camera.py diff --git a/scripts/examples/50-Arduino-Boards/Nano-RP2040/04-Bluetooth/ble_blinky.py b/scripts/examples/50-Arduino-Boards/Nano-RP2040/04-Bluetooth/ble_blinky.py deleted file mode 100644 index 853796f49..000000000 --- a/scripts/examples/50-Arduino-Boards/Nano-RP2040/04-Bluetooth/ble_blinky.py +++ /dev/null @@ -1,66 +0,0 @@ -# This work is licensed under the MIT license. -# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved. -# https://github.com/openmv/openmv/blob/master/LICENSE -# -# Bluetooth Blinky Example -# -# Use nRFConnect app from the App store, connect to the Nano and write 1/0 to control the LED. - -import bluetooth -import time -from ble_advertising import advertising_payload -from machine import Pin -from micropython import const - -LED_PIN = 6 - -_IRQ_CENTRAL_CONNECT = const(1) -_IRQ_CENTRAL_DISCONNECT = const(2) -_IRQ_GATTS_WRITE = const(3) - -_FLAG_READ = const(0x0002) -_FLAG_WRITE = const(0x0008) -_FLAG_NOTIFY = const(0x0010) -_FLAG_INDICATE = const(0x0020) - -_SERVICE_UUID = bluetooth.UUID(0x1523) -_LED_CHAR_UUID = (bluetooth.UUID(0x1525), _FLAG_WRITE) -_LED_SERVICE = ( - _SERVICE_UUID, - (_LED_CHAR_UUID,), -) - - -class BLETemperature: - def __init__(self, ble, name="NANO RP2040"): - self._ble = ble - self._ble.active(True) - self._ble.irq(self._irq) - ((self._handle,),) = self._ble.gatts_register_services((_LED_SERVICE,)) - self._connections = set() - self._payload = advertising_payload(name=name, services=[_SERVICE_UUID]) - self._advertise() - - def _irq(self, event, data): - # Track connections so we can send notifications. - if event == _IRQ_CENTRAL_CONNECT: - conn_handle, _, _ = data - self._connections.add(conn_handle) - elif event == _IRQ_CENTRAL_DISCONNECT: - conn_handle, _, _ = data - self._connections.remove(conn_handle) - # Start advertising again to allow a new connection. - self._advertise() - elif event == _IRQ_GATTS_WRITE: - Pin(LED_PIN, Pin.OUT).value(int(self._ble.gatts_read(data[-1])[0])) - - def _advertise(self, interval_us=500000): - self._ble.gap_advertise(interval_us, adv_data=self._payload) - - -if __name__ == "__main__": - ble = bluetooth.BLE() - temp = BLETemperature(ble) - - while True: - time.sleep_ms(1000) diff --git a/scripts/examples/50-Arduino-Boards/Nano-RP2040/04-Bluetooth/ble_temperature.py b/scripts/examples/50-Arduino-Boards/Nano-RP2040/04-Bluetooth/ble_temperature.py deleted file mode 100644 index 6d8a5c5e9..000000000 --- a/scripts/examples/50-Arduino-Boards/Nano-RP2040/04-Bluetooth/ble_temperature.py +++ /dev/null @@ -1,103 +0,0 @@ -# This work is licensed under the MIT license. -# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved. -# https://github.com/openmv/openmv/blob/master/LICENSE -# -# This example demonstrates a simple temperature sensor peripheral. -# -# The sensor's local value updates every second, and it will notify -# any connected central every 10 seconds. - -import bluetooth -import random -import struct -import time -from ble_advertising import advertising_payload -from machine import Pin -from micropython import const - -LED_PIN = 6 - -_IRQ_CENTRAL_CONNECT = const(1) -_IRQ_CENTRAL_DISCONNECT = const(2) -_IRQ_GATTS_INDICATE_DONE = const(20) - -_FLAG_READ = const(0x0002) -_FLAG_NOTIFY = const(0x0010) -_FLAG_INDICATE = const(0x0020) - -# org.bluetooth.service.environmental_sensing -_ENV_SENSE_UUID = bluetooth.UUID(0x181A) -# org.bluetooth.characteristic.temperature -_TEMP_CHAR = ( - bluetooth.UUID(0x2A6E), - _FLAG_READ | _FLAG_NOTIFY | _FLAG_INDICATE, -) -_ENV_SENSE_SERVICE = ( - _ENV_SENSE_UUID, - (_TEMP_CHAR,), -) - -# org.bluetooth.characteristic.gap.appearance.xml -_ADV_APPEARANCE_GENERIC_THERMOMETER = const(768) - - -class BLETemperature: - def __init__(self, ble, name="NANO RP2040"): - self._ble = ble - self._ble.active(True) - self._ble.irq(self._irq) - ((self._handle,),) = self._ble.gatts_register_services((_ENV_SENSE_SERVICE,)) - self._connections = set() - self._payload = advertising_payload( - name=name, - services=[_ENV_SENSE_UUID], - appearance=_ADV_APPEARANCE_GENERIC_THERMOMETER, - ) - self._advertise() - - def _irq(self, event, data): - # Track connections so we can send notifications. - if event == _IRQ_CENTRAL_CONNECT: - conn_handle, _, _ = data - self._connections.add(conn_handle) - Pin(LED_PIN, Pin.OUT).high() - elif event == _IRQ_CENTRAL_DISCONNECT: - conn_handle, _, _ = data - self._connections.remove(conn_handle) - # Start advertising again to allow a new connection. - self._advertise() - Pin(LED_PIN, Pin.OUT).low() - elif event == _IRQ_GATTS_INDICATE_DONE: - conn_handle, value_handle, status = data - - def set_temperature(self, temp_deg_c, notify=False, indicate=False): - # Data is sint16 in degrees Celsius with a resolution of 0.01 degrees Celsius. - # Write the local value, ready for a central to read. - self._ble.gatts_write(self._handle, struct.pack("