An awesome sample code to jumpstart your knowledge!
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
AMYTOL created Library and Sample Code for you to get started
This library is designed to easily access a variety of functionality.
The Ultrasonic sensor uses the provided library NewPing no need for an additional library
Wiring for the NewPing version of the Ultrasonic device is:
| Connector | Pin | Wire Colour |
|---|---|---|
| J8 | GROVE | Ultrasonic |
This program assumes wiring for the H-Bridge motor driver inputs
and allocation of Arduino output pins are as outlined in the tables below.
| Grove Connector | Grove Pin | Wire Colour | To Motor Driver | Arduino Pin | Notes |
|---|---|---|---|---|---|
| J1 | 1 | Yellow | PWM A | 2 | Left Motor PWM duty cycle for Speed |
| J1 | 2 | White | DIR A | 3 | Left Motor for Direction |
| J1 | 3 | Not Used | Not Used | ||
| J1 | 4 | Black | Not Used | ||
| J4 | 1 | Yellow | PWM B | 5 | Right Motor PWM duty cycle for Speed |
| J4 | 2 | White | DIR B | 6 | Right Motor for Direction |
| J4 | 3 | Not Used | Not Used | ||
| J4 | 4 | Black | GND | ||
| J3 | Ultrasonic | ||||
| J8 |
| From Motor Driver | Motor | Wire Colour |
|---|---|---|
| A+ | Left Motor | Red |
| A- | Left Motor | Black |
| B- | Right Motor | Red |
| B+ | Right Motor | Black |
Created by Andrew Morgan September 8th 2023 All My Things On Line AMYTOL wwww.AllMyThingsOnLine.com
This is an Arduino library to demonstrate how you to extend the functionality of Arduino C+.
Pin configuration is stored in the Construction file called by yhe constraint
Libary autocomplete prefix is "rbt"
ArduinoWorkspace --- /
AMYTOL_Robot/ ----+ /
examples/-------- + AmytolRobot.ino
src/ -------- + AmytolRobot.cpp
+ AmytolRobot.h
Rbt rbt (007); Secret Agent Pin Delaration
| Variable Name and Value |
|---|
| BATTERY_PIN = 0 |
| ultrasonicPin = 7 |
| buzzerPin = 8 |
| touchSensorPin = 9 |
| buzzer = 8 |
| fast_speed = 255 milliseconds |
| medFast_speed = 240 milliseconds |
| medium_speed = 150 milliseconds |
| medLow_speed = 140 milliseconds |
| slow_speed = 80 milliseconds |
| tenthofaSecond = 100 milliseconds |
| halfaSecond = 500 milliseconds |
| oneSecond = 1000 milliseconds |
| twoSeconds = 2000 milliseconds |
| fiveSeconds = 5000 milliseconds |
| num_times_to_repeat =1 |
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.