0

I wrote a script with the while loop command and I executed it on my Raspberry Pi, however I didn't put a break in it, so it won't stop. I tried to interrupt it, but the script is still being executed. I used thonny Python and I tried to exit it, Ctrl+C, soft reboot. I even tried to put it in storage mode and reset it, but it's still being executed. I'm trying to work out how to completely delete the script from the pico itself. Do you have any ideas?

Python:

from machine import Pin
from time import sleep
led = Pin(25, Pin.OUT)
while True:
    led.toggle()
    sleep(0.5) 
Jonas
  • 121,568
  • 97
  • 310
  • 388
  • Do I understand correctly, that you have loaded your script onto a Raspberry Pi Pico? There's no operating system on that, so you can't "terminate" your script. It will run until you disconnect the power (and restart once the power is re-applied). – PMF Nov 20 '21 at 20:57

1 Answers1

0

I'm reasonably sure that RPiOS has a task manager, so you could try killing it in that.

If it doesn't then open up your terminal and run ps -ef to find the PID of the python process (it should show the name of the command). Then run sudo kill -9 <PID> to kill it manually.

Edit:

I now understand that the RPi Pico is actually a microcontroller. Have you tried uploading a new program or just unplugging it from power to force it to reboot?

Xander Bielby
  • 161
  • 1
  • 12
  • soz im using a pico with micropython, so the only way i can use it is in thonny. I dont know if you can install rpios on it, but thonny is what im using to create and execute the sripts. thanks. – nxghtriderdev Nov 20 '21 at 15:40
  • nevermind, i managed to fix it, all i had to do was use a program that renames the "main.py" script to "main-1.py" so it doesnt work on startup. Thanks. – nxghtriderdev Nov 21 '21 at 12:31