Document toolboxDocument toolbox

Revolution Pi Python Introduction

A quick and easy introduction to how to use the RevPi with the Python programming language.

Why Python?

LED switch with Python

  • Works like writing a "1" to the location in the process image where the RevPiLED is located

  • Where is the RevPiLED located in the process image?

  • Run the following command

piTest -v RevPiLED
  • At offset 119

Read or write strings

The devices in PiCtory usually provide byte access to the data. You can test this example by using a Virtual Device 32 Bytes in PiCtory.

We read out the offset of “Output_1” variable. This may vary on your configuration, so be careful here.

Python example code

Verify the contents of the process image with piTest

RevPiModIO

  • Library developed from the RevPi community

  • Allows easy use of symbolic names from PiCtory

  • Installation not necessary, already on the device

  • Documentation

Switch the LED with RevPiModIO

 Python I/O Bit Mirror

Video Tutorials

Also, take a look at our video tutorials about Python

Besides, take a look at the following video tutorials

Verwandte Artikel