From 4971e86d05c714ff3630ada8851938614128b412 Mon Sep 17 00:00:00 2001 From: Abel Tim Date: Sat, 22 Jun 2024 09:17:50 +0200 Subject: update repo structure update poster add code flowchart --- CODE/CODE.ino | 1 + CODE/code_flowchart.svg | 1654 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1655 insertions(+) create mode 100644 CODE/code_flowchart.svg (limited to 'CODE') diff --git a/CODE/CODE.ino b/CODE/CODE.ino index 5f04f5c..c593334 100644 --- a/CODE/CODE.ino +++ b/CODE/CODE.ino @@ -97,6 +97,7 @@ MAKE_TYPE_INFO( short ) void setup() { Serial.begin(9600); + - Serial1.begin(19200); //connect unconected pins to GND diff --git a/CODE/code_flowchart.svg b/CODE/code_flowchart.svg new file mode 100644 index 0000000..a3bfa16 --- /dev/null +++ b/CODE/code_flowchart.svg @@ -0,0 +1,1654 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + Teensy code + SETUP: + Define all ports and create variables + + -Start serial connection with OpenMV canmera and with a posibly connected computer + -Start I2C connection with the port multiplexers + -Start serial connection with OpenMV canmera and with a posibly connected computer + -Connect unconected pins to ground + + -Configure IR sensors + + + + + + LOOP + + collect sensor data + -gather IR sensor data + -select color sensor N and gather its extract color from data + + 6x + -collect location of the goal from openMV + -Read compas data + + Print all data to serial port for debuging. + + + + + Do the color sensors see a line? + + + YES + + + NO + Move back. + + + Is the robot in posesion of the ball? + + YES + + + NO + + Do we see the ball? + + NO + + + YES + + + move towards the ball + Have we seen the ball in the last 10 loops? + + NO + + Start spinning whilst moving on the field + + + + + + + + + + + + + + + + + + + Is our front aimed towards the goal? + + YES + + + NO + + Turn towards the goal. + Move towards the goal. + + + + + + + + YES + + Continue last direction. + + + + + + -- cgit v1.2.3