Skip to content

Instantly share code, notes, and snippets.

@salvatorecapolupo
Created November 10, 2025 13:56
Show Gist options
  • Select an option

  • Save salvatorecapolupo/e8dc06d8d72914541ec3e0550c0bac26 to your computer and use it in GitHub Desktop.

Select an option

Save salvatorecapolupo/e8dc06d8d72914541ec3e0550c0bac26 to your computer and use it in GitHub Desktop.
Uso del terminale di comando per controllare led di Arduino UNO. comando ls /dev/ e script bash per controllarlo da interfaccia USB
#!/bin/bash
PORT="/dev/cu.usbmodem12301" # <— porta corretta per macOS
BAUD=9600
stty -f $PORT $BAUD -echo -icanon
echo "Connessione a $PORT aperta (baud: $BAUD)"
echo "Scrivi un carattere e premi Invio (CTRL+C per uscire)"
while true; do
read -p "> " input
echo "$input" > $PORT
cat $PORT &
sleep 0.5
kill $! 2>/dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment