Led on and off via AP network. First go.

 Took some code from elsewhere. Got to control leds on PicoW via buttons on Chrome. See below:





The Thonny micropython program WiFiAPLEDS1.py is here <script src="https://pastebin.com/embed_js/APvZscup"></script>
and  was based on a previous one, WiFiAP0.py and also used for finding a key word like 'ledon' in response this site. The internet access had to be set to internal AL network called NAME and away from Spark's usual one.
The simpleled.html file follows:(some parts not used)
<!DOCTYPE html>
<html>
<head>
    <title>Raspberry Pi Pico Simple LED</title>
</head>
<body>
<p>Click the buttons to control the LED</p>
<input type="button" onclick="document.location='/ledon'" value="TURN LED ONnnnn"/>
<p></p>
<input type="button" onclick="document.location='/ledoff'" value="TURN LED OFF"/>
<p></p>
<p>The LED is **ledState**</p>
</body>
</html>

Next, tidy this up and get button for alternative response eg send csv file.

Comments

Popular posts from this blog

Reading LittleFS file into buffer for sending

ESP32 buttons and bouncing