ThingBot Telemetrix Python client for interacting with ThingBot hardware
Reason this release was yanked:
Pre-release version, please use 1.0 version for fully supported.
Project description
(# ThingBot Telemetrix — Python API Reference)
This section documents the primary Python API for controlling a ThingBot board via the Telemetrix library.
Board Initialization
board: The main board object created when the Telemetrix connection is initialized. Use this object to read from sensors and control actuators.
Digital & Analog I/O
digital_write(pin_number, value): Set a digitalpin_numbertovalue(0/Falseor1/True). Used for driving LEDs, relays, or other digital outputs.analog_write(pin_number, value): Set an analog (PWM)pin_numbertovalue(typically0..255or0.0..1.0depending on board). Used for PWM-controlled LEDs, motors (through driver), etc.digital_read(pin_number): Read and return the current digital value onpin_number(0or1).analog_read(pin_number): Read and return the analog value onpin_number(ADC reading, typically an integer or float depending on board resolution).
Pin Mode Helpers
set_pin_mode_analog_output(pin_number): Configurepin_numberfor analog (PWM) output.set_pin_mode_digital_output(pin_number): Configurepin_numberfor digital output.set_pin_mode_analog_input(pin_number, callback): Configurepin_numberas an analog input.callback(value)is invoked when readings are received.set_pin_mode_digital_input(pin_number, callback): Configurepin_numberas a digital input.callback(value)is invoked on changes or reports.set_pin_mode_dht(pin_number, callback, dht_type): Configurepin_numberfor a DHT sensor (e.g., DHT11/DHT22).callback(data)receives temperature/humidity payloads;dht_typeselects sensor model.
Actuator Controls
control_dc(dc_number, speed): Control a DC motor driver channeldc_number.speedis typically in the range-255..255(negative for reverse) or-1.0..1.0depending on board conventions.control_servo(servo_number, speed): Control a servo onservo_number.speedis interpreted as an angle or normalized position depending on board firmware (commonly0..180degrees or-1.0..1.0).
Examples
-
Set pin 13 HIGH (digital):
board.digital_write(13, 1)
-
PWM a pin (half duty):
board.analog_write(5, 128)
-
Register a digital input callback:
def on_change(value): print('Digital value:', value) board.set_pin_mode_digital_input(7, on_change)
-
Control a DC motor and a servo:
board.control_dc(1, 200) # run DC channel 1 forward board.control_servo(0, 90) # move servo 0 to 90 degrees
Notes
- Exact value ranges (e.g., PWM scale or servo angle units) depend on the board firmware and should be confirmed against your platform's docs. Callbacks receive raw values as delivered by the board; convert/scale as needed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thingbot_telemetrix-0.0.1.tar.gz.
File metadata
- Download URL: thingbot_telemetrix-0.0.1.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5444ae55f437aa4542f593f67dfa883404b13edfa1b6a235b50caab9ded5b7de
|
|
| MD5 |
4ddcac9d7099252183884a3bffcc1047
|
|
| BLAKE2b-256 |
3d4decc07c454aadbf7411e978e4856dcfa4c306361fb0f81f6dda0de848f0f9
|
File details
Details for the file thingbot_telemetrix-0.0.1-py3-none-any.whl.
File metadata
- Download URL: thingbot_telemetrix-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c98585394d1d90d56edcfbbe685c18922318b9b92e1c3a432677e690ae0af675
|
|
| MD5 |
5f59a01733d245dd0d7a5e6819afa617
|
|
| BLAKE2b-256 |
5857651700b80411850b98bf5fc1a3706a0b7ca327249c4219a1ba7bb273302e
|