2022-07-01 07:05:37 +01:00
# Automation 2040 W Micropython Examples <!-- omit in toc -->
- [Function Examples ](#function-examples )
2022-10-06 15:54:50 +01:00
- [PWM Outputs ](#pwm-outputs )
2022-07-01 07:05:37 +01:00
- [Read ADCs ](#read-adcs )
- [Read Inputs ](#read-inputs )
- [Toggle Relays ](#toggle-relays )
- [Toggle Outputs ](#toggle-outputs )
- [Switches and LEDs ](#switches-and-leds )
- [Reset Automation ](#reset-automation )
2022-07-15 11:31:55 +01:00
- [Wireless Examples ](#wireless-examples )
- [Web IO Interface ](#web-io-interface )
2022-07-01 07:05:37 +01:00
## Function Examples
2022-10-06 15:54:50 +01:00
These examples will work with Automation 2040 W and Automation 2040 W Mini. If you have an Automation 2040 W Mini, initialise your board with `board = Automation2040WMini` to see the correct numbers of inputs, outputs and relays!
### PWM Outputs
[pwm_outputs.py ](pwm_outputs.py )
Shows how to PWM the output terminals of Automation 2040 W.
2022-07-01 07:05:37 +01:00
### Read ADCs
[read_adcs.py ](read_adcs.py )
2022-10-06 15:54:50 +01:00
Shows how to read the ADC terminals of Automation 2040 W.
2022-07-01 07:05:37 +01:00
### Read Inputs
[read_inputs.py ](read_inputs.py )
2022-10-06 15:54:50 +01:00
Shows how to read the input terminals of Automation 2040 W.
2022-07-01 07:05:37 +01:00
### Toggle Relays
[toggle_relays.py ](toggle_relays.py )
Demonstrates how to toggle the actuation state of each of Automation 2040 W's relays.
### Toggle Outputs
[toggle_outputs.py ](toggle_outputs.py )
Demonstrates how to toggle each of Automation 2040 W's output terminals.
### Switches and LEDs
[switches_and_leds.py ](switches_and_leds.py )
An example of the user switches and LEDs on Automation 2040 W.
### Reset Automation
[reset_automation.py ](reset_automation.py )
A simple program that resets Automation 2040 W, turning off its Relays, Outputs, and LEDs.
2022-07-15 11:31:55 +01:00
## Wireless Examples
2022-10-06 15:54:50 +01:00
The wireless examples need `network_manager.py` and `WIFI_CONFIG.py` from the `micropython/examples/common` directory to be saved to your Pico W. Open up `WIFI_CONFIG.py` in Thonny to add your wifi details (and save it when you're done).
2022-07-15 11:31:55 +01:00
### Web IO Interface
[web_io_interface/ ](web_io_interface/ )
Provides a basic web interface for all your Automation 2040W features.
2022-10-06 15:54:50 +01:00
Needs `lib/tinyweb` from `micropython/examples/common` !