Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Exercise 3: SwitchesIntroduction | ||||||||
Line: 13 to 13 | ||||||||
![]() | ||||||||
Added: | ||||||||
> > |
| |||||||
Deleted: | ||||||||
< < | ![]() | |||||||
Exercise 1:The push button switch is connected to GPIO 22 on the ESP32 board. | ||||||||
Line: 57 to 58 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Exercise 3: SwitchesIntroduction | ||||||||
Line: 36 to 36 | ||||||||
The ESP32 has an interface to read capacitive touch sensors (see https://docs.micropython.org/en/latest/esp32/quickref.html?highlight=touchpad![]() Exercise 6: | ||||||||
Changed: | ||||||||
< < | Write a program scanning the PIR sensor, indicating if a person is close. The PIR sensor, just like the push button, uses a single GPIO line as input. The boards allow choosing which GPIO to use, and I selected D4 = GPIO 16 | |||||||
> > | Write a program scanning the PIR sensor, indicating if a person is close. The PIR sensor, just like the push button, uses a single GPIO line as input. The boards allow choosing which GPIO to use, and I selected D1 = GPIO 22 | |||||||
Exercise 7:The sensor kit in the lab contains a big number of sensors acting like switches: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Exercise 3: SwitchesIntroduction | ||||||||
Line: 27 to 27 | ||||||||
Do the same thing as in exercise 1 but use external interrupts and a callback routine to do the job.
Exercise 3: | ||||||||
Changed: | ||||||||
< < | Combine this exercise with the exercise on LEDs: Switch the builtin LED on when the button is pressed and off when it is released | |||||||
> > | Combine this exercise with the exercise on LEDs: Switch the built-in LED on when the button is pressed and off when it is released | |||||||
Exercise 4: | ||||||||
Changed: | ||||||||
< < | Write a program scanning the PIR sensor, indicating if a person is close. The PIR sensor, just like the push button, uses a single GPIO line as input. The boards allows to choose which GPIO to use and I selected D4 = GPIO 16 | |||||||
> > | Modify exercise 3 such that a single push-and-release will switch the LED on, and a second push-and-release will switch it off again. This type of switches you find e.g. on table lamps. You may find that your program sometimes does not work as expected, which may be due to switch bouncing![]() | |||||||
Exercise 5: | ||||||||
Added: | ||||||||
> > | The ESP32 has an interface to read capacitive touch sensors (see https://docs.micropython.org/en/latest/esp32/quickref.html?highlight=touchpad![]() Exercise 6:Write a program scanning the PIR sensor, indicating if a person is close. The PIR sensor, just like the push button, uses a single GPIO line as input. The boards allow choosing which GPIO to use, and I selected D4 = GPIO 16Exercise 7: | |||||||
The sensor kit in the lab contains a big number of sensors acting like switches:
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Exercise 3: SwitchesIntroduction | ||||||||
Line: 50 to 50 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Exercise 3: SwitchesIntroduction | ||||||||
Line: 31 to 31 | ||||||||
Exercise 4:Write a program scanning the PIR sensor, indicating if a person is close. The PIR sensor, just like the push button, uses a single GPIO line as input. The boards allows to choose which GPIO to use and I selected D4 = GPIO 16 | ||||||||
Added: | ||||||||
> > | Exercise 5:The sensor kit in the lab contains a big number of sensors acting like switches:
| |||||||
-- ![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Exercise 3: SwitchesIntroduction | ||||||||
Line: 28 to 28 | ||||||||
Exercise 3:Combine this exercise with the exercise on LEDs: Switch the builtin LED on when the button is pressed and off when it is released | ||||||||
Added: | ||||||||
> > | Exercise 4:Write a program scanning the PIR sensor, indicating if a person is close. The PIR sensor, just like the push button, uses a single GPIO line as input. The boards allows to choose which GPIO to use and I selected D4 = GPIO 16 | |||||||
-- ![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Exercise 3: SwitchesIntroduction | ||||||||
Changed: | ||||||||
< < | Switches exist in various incarnations. There is the simple mechanical switches: on/off or push button switches but there are also switches than turn on or off with various external conditions: | |||||||
> > | Switches exist in various incarnations. There are the simple mechanical switches: on/off or push button switches but there are also switches than turn on or off with various external conditions: | |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
Exercise 3: SwitchesIntroductionSwitches exist in various incarnations. There is the simple mechanical switches: on/off or push button switches but there are also switches than turn on or off with various external conditions:
![]() ![]() Exercise 1:The push button switch is connected to GPIO 17 on the ESP32 board. Write a script that polls the state of the switch every 100 ms and prints state changes (only print out a message when the switch state has changed). Catch <ctrl> C to smoothly exit the program. Check https://docs.micropython.org/en/latest/esp8266/tutorial/pins.html![]() ![]() Exercise 2:Do the same thing as in exercise 1 but use external interrupts and a callback routine to do the job.Exercise 3:Combine this exercise with the exercise on LEDs: Switch the builtin LED on when the button is pressed and off when it is released --![]() Comments
|