Upload files to "/"

This commit is contained in:
2026-04-14 20:35:49 +00:00
parent 6b71a1bbae
commit 7a23dca68f
3 changed files with 112 additions and 0 deletions

31
srvop Normal file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
#SRVOP - SERVO POSITIOIN - VARIABLE POSITION [DEGREES]
#sudo apt install arduino-cli
#source srvo
clear
echo "SET SERVO POSITION [DEGREES]:"
read -r pos
mkdir -p ./servo/
echo "
#include <Servo.h>
Servo servo; // Create a servo object
void setup() {
// put your setup code here, to run once:
servo.attach(9); // Attach the servo to pin
servo.write($pos); // Tell servo to go to position in variable 'pos'
delay(0); // Wait for the servo to reach the position
}
void loop() {
// put your main code here, to run repeatedly:
}
" | tee ./servo/servo.ino #>> ./servo/servo.ino
#arduino-cli lib install Servo
arduino-cli compile --fqbn $fqbn --port /dev/tty$port ./servo/servo.ino
arduino-cli upload --fqbn $fqbn --port /dev/tty$port ./servo/servo.ino
clear
./srvop