Tutorials - Intro Page
Welcome to the CrcDuino system tutorial section
The objective of the tutorials is to present how to use CrcLib to program a CrcDuino interfaced with various sensors and actuators using typical use cases encountered in most CRC Robotics Competition robots.
Before digging into the tutorials, we recommend that you first familiarize yourselves with the following concepts:
Throughout, refer to the specific explanation page for each CrcLib functions to learn more about their use and details.
Tutorials
Switch limited motor: Learn how to wire a limit switch and use its state to allow a continuous type 5V servo-motor to run.
Delay() alternative: Learn how to cleanly mimic the Arduino-native Delay() function for the CrcDuino and send a timed position command to a standard type 5V servo-motor.
I2C ultrasonic sensor: Learn how to interface with sensors communicating over the I2C protocol and monitor the distance measured by an ultrasonic sensor.
Motor encoder: Learn how to wire a 12V motor controller, 12V motor and its quadrature encoder and use its feedback to stop the motor motion at a desired position.
Sequential program structure: Learn how to easily structure a program to execute sequential actions. Recommending coding strategy for autonomous robots performing sequential actions. This program is shown implemented using IF statements, as well as a Switch Case statement. To be read along Tutorial 11.
Tutorial concatenation: An example on how to sequentially execute tutorial 1 to 5 in a single program. This program is shown implemented using hardcoding, as well as function-based programming.
Analog sensor: Learn how to interface with sensor returning their feedback using a variable DC voltage and monitor the distance measured by an ultrasonic sensor.
Input debouncing and rising/falling edge detection: Learn how to overcome the problems caused by mechanical contact flickering on state change, as well as recognizing when an input goes from LOW to HIGH vs. HIGH to LOW.
Function-based coding: Learn how to create your own functions for a CrcDuino (or any Arduino board) program.
Library-based coding: Learn how to create your own library (a set of function that is written in a single place, but usable from multiple different .ino files) for a CrcDuino (or any Arduino board) program.
Designing your robot with sequential action coding in mind: An explanation to the whys and hows of coding a robot designed to perform a pre-determined sequence of actions.