Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Python Samples

This directory includes Python samples for Turta IoT HAT 3.


  • Demonstrates reading the 3D acceleration data.
  • Demonstrates most of the IoT HAT's functionality together.
  • Demonstrates reading the ambient light data.
  • Demonstrates measuring differential analog inputs from analog ports.
  • Demonstrates measuring single-ended analog inputs from analog ports.
  • Demonstrates reading onboard button press state using interrupt.
  • Demonstrates reading onboard button press state.
  • Demonstrates switching the relays with button press.
  • Demonstrates using the piezo sounder.
  • Demonstrates digital port read and write.
  • Demonstrates detecting hand gestures using GPIO interrupt.
  • Demonstrates detecting hand gestures.
  • Demonstrates sending infrared remote controller messages using NEC protocol.
  • Demonstrates reading input states of photocoupler using interrupt.
  • Demonstrates reading photocoupler input states.
  • Demonstrates measuring proximity.
  • Demonstrates toggling the solid state relays.
  • Demonstrates reading RGB light.
  • Demonstrates detecting tilt without using I2C bus.

Running the Python Samples

  • Copy the sample code to your Raspberry Pi.
  • Install the libraries with 'pip3 install turta-iothat3' command.
  • Run the sample with 'python3 <Sample_Name>.py' command.
  • Exit from the sample using CTRL+C or ^C key.


Visit for documentation.

You can’t perform that action at this time.