Σχόλια σε: Pico W https://picockpit.com/raspberry-pi/el/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/ Πέμπτη, 01 Αυγ 2024 16:09:07 +0000 ωριαία 1 https://wordpress.org/?v=7.0 Από: Tonton https://picockpit.com/raspberry-pi/el/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-22499 Πέμπτη, 01 Αυγ 2024 16:09:07 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-22499 Σε απάντηση στο Gunther.

J’ai résolu le problème en ajoutant la ligne :
r = r[:50]
avant
led_on = r.find(‘?led=on’)
led_off = r.find(‘?led=off’)

Cela retire les caractères superflus de la requête

]]>
Από: Γκούντερ https://picockpit.com/raspberry-pi/el/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-3942 Δευτέρα, 28 Νοεμβρίου 2022 00:53:51 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-3942 I tried to comment, but somehow the comment does not come out correctly…

]]>
Από: Γκούντερ https://picockpit.com/raspberry-pi/el/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-3941 Δευτέρα, 28 Νοεμβρίου 2022 00:51:05 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-3941 The search by find function does also return a value if eg. the referrer contains the ‘led=xx’ string. So both led_on and led_off get a positive value at the same time and the LED is switched off again, when it was desired to switch on. To overcome this, the if statement has to be extended to check for a small index value (I used 20 only as a rule of thumb):

if (led_on > -1 and led_on -1 and led_off < 20):
Now it works as expected.

]]>
Από: Charles https://picockpit.com/raspberry-pi/el/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-2629 Τρί, 25 Οκτ 2022 20:51:40 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-2629 In line 100 you use get_html() function. When I run your code I get a ‘get_html’ isn’t defined error.

]]>
Από: Ian https://picockpit.com/raspberry-pi/el/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-1296 Κυρ, 17 Ιουλ 2022 19:15:57 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-1296 Σε απάντηση στο Pablo.

Hi Pablo – make sure you are using the latest UF2 file for the Pico W (not just the Pico) – found here. https://www.raspberrypi.com/documentation/microcontrollers/micropython.html

The network module is there as standard!

]]>
Από: Pablo https://picockpit.com/raspberry-pi/el/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-1269 Τετ, 13 Ιουλ 2022 16:31:56 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-1269 Error found when i trie it

%Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File “”, line 1, in
ImportError: no module named ‘network’

]]>