Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added pseudocode of basic line-following algorithm

Example line following algorithm
  • Loading branch information...
commit f30d97879404a4f6cdb06e19312256a6a1222341 1 parent 6211db5
@tcwan authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 nxos/systems/tribot/tribot.S
View
16 nxos/systems/tribot/tribot.S
@@ -2,8 +2,10 @@
* @brief Tribot Test Program
* Test Tribot
*
+ * The following behaviors have been implemented
+ * - Line following (Light Sensor: WIP)
+ * - Object Detection (Touch)
*
- * [Optionally, more stuff about the component in general.]
* This file must be processed using cpp before assembly.
*/
@@ -97,6 +99,18 @@ break:
nop /* Prevent GDB from stepping inside nx_systick_wait_ms due to breakpoint */
mov r0, #SYSTICK_1000MS
bl nx_systick_wait_ms
+
+ /* Line Follower Algorithm:
+ * 1. Collect Samples
+ * 2. Find Min-Max (range)
+ * 3. Determine if we're:
+ * -- inside line
+ * -- on edge
+ * -- outside line
+ * 4. If Inside Line, move straight ahead
+ * 5. If On Edge, rotate slowly
+ * 6. If Outside Line, rotate quickly
+ */
loop:
mov r0, #TOUCH_PORT
bl nx_sensors_analog_get
Please sign in to comment.
Something went wrong with that request. Please try again.