The main goal is to make the process of work with ampy even simpler and more convenient.
Ampyw can do only 2 things:
- To put all your python files on the board with a single command (-f argument).
- To pass commands to ampy (you don't need to point a port in every command) (no arguments).
In order to let ampyw define your port automatically, you should edit the first script's line:
port="/dev/$(ls /dev | grep cu.wchusbserial)" # should be changed for non-MacOS
What goes on here? In MacOS a board is always binded to /dev/cu.wchusbserialxxxx
where xxxx
can very. ls /dev
shows all entries upon /dev
folder, grep cu.wchusbserial
filters them by cu.wchusbserial
string and finally received device name is attached to /dev/
. That's how it 'knows' your port.
If you use MacOS and this driver you should be ok.
Then place the script into the folder with your code!
And make it executable chmod +x ampyw
./ampyw.sh -f
./ampyw.sh rm main.py
./ampyw.sh ls