Skip to content

Commit 31b2718

Browse files
committed
first commit
0 parents  commit 31b2718

13 files changed

+2783
-0
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.vscode
2+
/persontrack.sublime-workspace
3+
/yolov5n.pt
4+
/yolov5s-cls.pt
5+
/yolov5s.pt
6+
/__pycache__

arduinoSketches/sketch_oct10a.ino.ino

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//Arduino Code
2+
3+
#include <Servo.h>
4+
5+
Servo myServo; // create servo object to control a servo
6+
int pos = 90; // variable to store the servo position
7+
String inString = ""; // string to hold input
8+
9+
void setup() {
10+
myServo.attach(9);
11+
// Open serial communications and wait for port to open:
12+
Serial.begin(115200);
13+
while (!Serial) {
14+
; // wait for serial port to connect. Needed for native USB port only
15+
}
16+
17+
// send an intro:
18+
Serial.println("\n\nString toInt():");
19+
Serial.println();
20+
}
21+
22+
void loop() {
23+
// Read serial input:
24+
while (Serial.available() > 0) {
25+
int inChar = Serial.read();
26+
if (isDigit(inChar)) {
27+
// convert the incoming byte to a char
28+
// and add it to the string:
29+
inString += (char)inChar;
30+
}
31+
// if you get a newline, print the string,
32+
// then the string's value:
33+
if (inChar == '\n') {
34+
Serial.print("Value:");
35+
Serial.println(inString.toInt());
36+
Serial.print("String: ");
37+
Serial.println(inString);
38+
39+
myServo.write(inString.toInt());
40+
// clear the string for new input:
41+
inString = "";
42+
}
43+
}
44+
}

arduinoSketches/test.ino

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#include <Servo.h>
2+
Servo myservo;
3+
int pos = 0;
4+
5+
6+
7+
void setup()
8+
9+
{
10+
11+
Serial.begin(9600);
12+
while (!Serial);
13+
Serial.println("-------------------------");
14+
Serial.println("ARos is loading....");
15+
delay(1000);
16+
Serial.println("ARos loaded succesfully");
17+
Serial.println("-------------------------");
18+
myservo.attach(9);
19+
Serial.println("calibrating servo...");
20+
for(pos = 0; pos <= 180; pos += 1)
21+
myservo.write(0);
22+
delay(1000);
23+
myservo.write(180);
24+
delay(1000);
25+
myservo.write(90);
26+
delay(1000);
27+
Serial.println("servo calibrated");
28+
Serial.println("-------------------------");
29+
Serial.println("Comand input online, write command to perform action");
30+
Serial.println("-------------------------");
31+
32+
}
33+
34+
void loop() {
35+
36+
for(pos = 0; pos <= 180; pos += 1)
37+
if (Serial.available())
38+
39+
40+
{
41+
int state = Serial.parseInt();
42+
43+
if (state < 10)
44+
45+
{
46+
Serial.print(">");
47+
Serial.println(state);
48+
Serial.println("cannost execute command, too low number");
49+
50+
}
51+
52+
if (state >= 10 && state < 170)
53+
{
54+
Serial.print(">");
55+
Serial.println(state);
56+
Serial.print("turning servo to ");
57+
Serial.print(state);
58+
Serial.println(" degrees");
59+
myservo.write(state);
60+
61+
}
62+
63+
}
64+
65+
}

0 commit comments

Comments
 (0)