pyCreate2.robot package¶
Submodules¶
pyCreate2.robot.create2_driver module¶
pyCreate2.robot.gpio module¶
Module to use ODROID’s GPIOs.
-
class
pyCreate2.robot.gpio.
Gpio
(number)[source]¶ Bases:
object
Class to use general purpose input/output (GPIO) pins.
This class specifically targets the standard linux support for GPIO as provided by ODROID. More details can be found here: http://odroid.com/dokuwiki/doku.php?id=en:c1_hardware_pwm. The sysfs interface is described here: https://www.kernel.org/doc/Documentation/gpio/sysfs.txt. It supports setting the value and waiting for a hardware interrupt.
-
set_direction
(direction)[source]¶ Set the direction (input/output) of the pin.
Parameters: direction (string) – One of “in”, “out”, “low”, “high”.
-
set_edge
(edge)[source]¶ Set the edge trigger for HW interrupt support. Use wait_for_interrupt to wait for an interrupt afterwards.
Parameters: edge (string) – One of “none”, “rising”, “falling”, “both”
-
pyCreate2.robot.pwm module¶
Module to use ODROID’s HW PWM.
-
class
pyCreate2.robot.pwm.
Pwm
(number=0)[source]¶ Bases:
object
Class to use general pulse-width-modulation.
This class specifically targets the standard linux support for PWM as provided by ODROID. More details can be found here: http://odroid.com/dokuwiki/doku.php?id=en:c1_hardware_pwm. The sysfs interface is described here: https://www.kernel.org/doc/Documentation/pwm.txt. It supports setting the value and waiting for a hardware interrupt.
pyCreate2.robot.servo module¶
pyCreate2.robot.sonar module¶
Module to interface a PING Sonar connected via GPIO
-
class
pyCreate2.robot.sonar.
Sonar
(pin)[source]¶ Bases:
object
Class to use the PING Sonar
This class assumes that the PING sonar is connected using a GPIO pin. It implements the protocol specified in https://www.parallax.com/sites/default/files/downloads/28015-PING-Documentation-v1.6.pdf using hardware interrupts.
Parameters: pin – GPIO pin number where the sonar is connected to.