~ | Reorganize tests files architecture

This commit is contained in:
ft-NotArt
2025-03-07 15:50:41 +01:00
parent d2b79fcbb1
commit 1be77c3aa3
3 changed files with 0 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
int x;
void setup() {
Serial.begin(9600);
Serial.setTimeout(1);
}
void loop() {
while (!Serial.available());
x = Serial.readString().toInt();
Serial.print(x + 1);
}
+14
View File
@@ -0,0 +1,14 @@
# Importing Libraries
import serial
import time
arduino = serial.Serial(port='/dev/ttyACM0', baudrate=9600, timeout=.1)
def write_read(x):
arduino.write(bytes(x, 'utf-8'))
time.sleep(0.05)
data = arduino.readline()
return data
while True:
num = input("Enter a number: ") # Taking input from user
value = write_read(num)
print(value) # printing the value