Skip to content

Commit

Permalink
Added Pycharm link to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MrYsLab committed Sep 16, 2023
1 parent bf4ade4 commit f7e417c
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 15 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ This Python package allows you to monitor and control an UNO R4 Minima or
WIFI board by simply writing a Python script using one of the telemetrix--uno-r4 APIs.
APIs are provided for both synchronous and asyncio implementations.

| Feature | Minima | WIFI | Notes |
|------------------------------------|:------:|:----:|:-------------------------------:|
| Analog Input | X | X | |
| Analog Output (PWM) | X | X | |
| Digital Input | X | X | |
| Digital Output | X | X | |
| i2c Primitives | X | X | |
| Servo Motor Control | X | X | Currently, BLE is not supported |
| DHT Temperature/Humidity Sensor | X | X | |
| HC-SR04 Sonar Distance Sensor | X | X | |
| SPI Primitives | X | X | |
| Scrolling Message Support | | X | |
| Integrated Debugging Aids Provided | X | X | |
| Examples ProvidedFor All Features | X | X | |
| Feature | Minima | WIFI | Notes |
|------------------------------------|:------:|:----:|:-----:|
| Analog Input | X | X | |
| Analog Output (PWM) | X | X | |
| Digital Input | X | X | |
| Digital Output | X | X | |
| i2c Primitives | X | X | |
| Servo Motor Control | X | X | |
| DHT Temperature/Humidity Sensor | X | X | |
| HC-SR04 Sonar Distance Sensor | X | X | |
| SPI Primitives | X | X | |
| Scrolling Message Support | | X | |
| Integrated Debugging Aids Provided | X | X | |
| Examples ProvidedFor All Features | X | X | |

For the Minima, communication with the Python client is supported by a USBSerial
transport.
Expand Down
68 changes: 68 additions & 0 deletions telemetrix_uno_r4/r4_wifi_examples/asyncio/BLE/wwb_servo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
"""
Copyright (c) 2023 Alan Yorinks All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 as published by the Free Software Foundation; either
or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""

import asyncio
import sys

from telemetrix_uno_r4.wifi.telemetrix_uno_r4_wifi_aio import telemetrix_uno_r4_wifi_aio

"""
This example will set a servo to 0, 90 and 180 degree
positions.
"""


async def servo(my_board, pin):
"""
Set a pin to servo mode and then adjust
its position.
:param my_board: telemetrix_aio instance
:param pin: pin to be controlled
"""
await my_board.start_aio()

# set the pin mode
await my_board.set_pin_mode_servo(pin)

await asyncio.sleep(1)

await my_board.servo_write(pin, 0)
await asyncio.sleep(1)
await my_board.servo_write(pin, 90)
await asyncio.sleep(1)
await my_board.servo_write(pin, 180)
await my_board.servo_detach(pin)

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

board = telemetrix_uno_r4_wifi_aio.TelemetrixUnoR4WiFiAio(autostart=False,
transport_type=2)
try:
loop.run_until_complete(servo(board, 5))
try:
loop.run_until_complete(board.shutdown())
except:
pass
sys.exit(0)
except KeyboardInterrupt:
try:
loop.run_until_complete(board.shutdown())
except:
pass
sys.exit(0)
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class PrivateConstants:
FEATURES = 20
DEBUG_PRINT = 99

TELEMETRIX_VERSION = "1.00"
TELEMETRIX_VERSION = "1.01"

# reporting control
REPORTING_DISABLE_ALL = 0
Expand Down

0 comments on commit f7e417c

Please sign in to comment.