I have a general understanding of microcontrollers and embedded systems but I am completely new to Raspberry pi. I have a task that requires fairly fast GPIO operations, so from the research I made, Micropython could bring more benefits than regular Python.
I wrote a sub-10 line led blink program in micropython, for learning and experimenting (put a .mpy extension to it) but I'm facing a problem on what to do next, how to execute it?
import machine
led = machine.Pin(21,machine.Pin.OUT)
while True:
led.high()
led.low()
As far as I found out, you cannot just write "python3 ledblink.py" in your Raspberry Pi terminal as you would for regular Python scripts. I tried to google it for quite some time, but everything I find is either ESP's or Pico's micropython tutorials. I need a detailed guide from textfile to execution on how to run the micropython file on Raspberry pi terminal (I am running a 3B+ model). I have installed my micropython following this guide: https://snapcraft.io/install/micropython/raspbian
AttributeError: 'module' object has no attribute 'Pin'– yep, as I assumed in my 2nd comment, the UNIX port of Micropython doesn't know about Pins (since no generic UNIX machine has "pins", and it's not a Raspberry Pi port).