[ S[IMSPIMLEPLEELEECLTERCOTRNOICNSICWSIWTHITGHPGIOPZIOERZOER]O ]Ryanteck MCB Robotgpiozero.RyanteckRobotExtends Robot for the Ryanteck MCB robot. Since its pins are fixed,there’s no need to specify them when constructing this class. Thefollowing example drives the robot forward:from gpiozero import RyanteckRobotrobot = RyanteckRobot()robot.forward() Methods: These are the same as for the Robot class.CamJam #3 Kit Robotgpiozero.CamJamKitRobotExtends Robot for the CamJam EduKit #3 robot. Since its pins are fixed,there’s no need to specify them when constructing this class. Thefollowing example drives the robot forward:from gpiozero import CamJamKitRobotrobot = CamJamKitRobot()robot.forward() Methods: These are the same as for the Robot class.[ Quick Reference ] 101
ESSENTIALS Energenie gpiozero.Energenie(socket=None, initial_value=False) Designed to represent an Energenie socket controller, this class is constructed with a socket number and an optional initial state (defaults to False, meaning off). Instances of this class can be used to switch peripherals on and off. For example: from gpiozero import Energenie lamp = Energenie(1) lamp.on() Methods: is_active Returns True if the device is currently active, and False otherwise. This property is usually derived from value. Unlike value, this is always a Boolean. source The iterable to use as a source of values for value. source_delay The delay (measured in seconds) in the loop used to read values from source. Defaults to 0.01 seconds, which is generally sufficient to keep CPU usage to a minimum while providing adequate responsiveness. values An infinite iterator of values read from value.102 [ Chapter OTwnel]ve ]
[ S[IMSPIMLEPLEELEECLTERCOTRNOICNSICWSIWTHITGHPGIOPZIOERZOER]O ][ Quick Reference ] 103
ESSENTIALS ESSENTIALS LEARN | CODE | MAKE AVAILABLE NOW: > CONQUER THE COMMAND LINE > EXPERIMENT WITH SENSE HAT > MAKE GAMES WITH PYTHON > CODE MUSIC WITH SONIC PI ESSENTIALS From the makers of the official Raspberry Pi magazine104 [ Chapter One ]
[ SIMPLE ELECTRONICS WITH GPIO ZERO ]OUT NOW IN PRINTONLY £3.99 fromraspberrypi.org/magpiGET THEMDIGITALLY: 105
ESSENTIALS raspberrypi.org/magpi
Search
Read the Text Version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106