Skip to content

Commit c121d13

Browse files
committed
removed advanced example as just a combo
1 parent f9aaa67 commit c121d13

File tree

4 files changed

+15
-50
lines changed

4 files changed

+15
-50
lines changed

docs/api.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,18 @@ Button
101101
:inherited-members:
102102
:members:
103103

104-
TouchSensor
105-
-----------
104+
Switch
105+
------
106106

107-
.. autoclass:: TouchSensor
107+
.. autoclass:: Switch
108108
:show-inheritance:
109109
:inherited-members:
110110
:members:
111111

112-
Switch
113-
------
112+
TouchSensor
113+
-----------
114114

115-
.. autoclass:: Switch
115+
.. autoclass:: TouchSensor
116116
:show-inheritance:
117117
:inherited-members:
118118
:members:

docs/examples/touch_sensor.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
from picozero import TouchSensor
1+
from picozero import TouchSensor, LED
22
from time import sleep
33

4+
# Capacitive touch sensor output connected to pin 2
45
touch = TouchSensor(2)
56

6-
print("Touch the sensor...")
7+
# Built-in LED
8+
led = LED(25)
79

810
while True:
911
if touch.is_touched:
10-
print("Touch detected!")
12+
led.on()
1113
else:
12-
print("No touch")
14+
led.off()
1315
sleep(0.1)

docs/examples/touch_sensor_advanced.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

docs/examples/touch_sensor_callbacks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from picozero import TouchSensor, LED
22
from time import sleep
33

4-
# Create a capacitive touch sensor on pin 2
4+
# Capacitive touch sensor output connected to pin 2
55
touch = TouchSensor(2)
66

7-
# Create an LED on pin 25 (built-in LED)
7+
# Built-in LED
88
led = LED(25)
99

1010

@@ -25,4 +25,4 @@ def released():
2525
while True:
2626
sleep(1)
2727
except KeyboardInterrupt:
28-
led.off() # Make sure LED is off when exiting
28+
led.off() # Turn LED off when exiting

0 commit comments

Comments
 (0)