BBR Sumo
  • Overview
  • Setup
    • Hardware
    • Software
  • Sensors
    • Distance Sensors
    • Line Sensor
    • DIP Switches
  • Movement
    • Motor Control
  • Tips
    • Arduino
      • Adjust Motor Direction
    • Python
Powered by GitBook
On this page
  1. Tips

Arduino

Looking to harness the full potential of the Sumo board. Program in c++

PreviousMotor ControlNextAdjust Motor Direction

Last updated 1 year ago

This is an advanced feature, the setup of Arduino is outside of the scope of this documentation. Basic information is provided.

The board will make use of the Arduino RP2040 board package found at:

Follow the install instructions from the above site.

To select a board, use the 'Raspberry Pi Pico'

Next, use the Arduino library manager to add the following library.

Once this library is added, the Sumo board can be used:

#include <Sumo.h>

Sumo sumo = Sumo();

void setup() {

  sumo.forward(255);
 
  delay(2000);
}

void loop() {
  // put your main code here, to run repeatedly:

}

An example that shows all of the board features:

#include <Arduino.h>
#include <Sumo.h>

Sumo sumo = Sumo();


void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Ready");
  delay(4000);
  sumo.forward(255);
  Serial.println("Forward");
  delay(2000);
  sumo.stop();
  Serial.println("Stop");
  delay(2000);
  sumo.reverse(255);
  Serial.println("Reverse");
  delay(1000);
  sumo.coast();
  Serial.println("Coast");

  //SETUP PINS
  pinMode(DIP1, INPUT_PULLUP);
  pinMode(DIP2, INPUT_PULLUP);
  pinMode(DIP3, INPUT_PULLUP);

  pinMode(AC1, INPUT);
  pinMode(AC2, INPUT);
  pinMode(AC3, INPUT);
  pinMode(AC5, INPUT);

  pinMode(DC4, INPUT);

  pinMode(DCB1, INPUT);
  pinMode(DCB2, INPUT);

  
}

void loop() {
  // put your main code here, to run repeatedly:

  Serial.print("DIP1: ");
  Serial.println(digitalRead(DIP1));

  Serial.print("DIP2: ");
  Serial.println(digitalRead(DIP2));

  Serial.print("DIP3: ");
  Serial.println(digitalRead(DIP3));

  Serial.print("DC4: ");
  Serial.println(digitalRead(DC4));

  Serial.print("AC1: ");
  Serial.println(analogRead(AC1));

  Serial.print("AC2: ");
  Serial.println(analogRead(AC2));

  Serial.print("AC3: ");
  Serial.println(analogRead(AC3));

  Serial.print("AC5: ");
  Serial.println(analogRead(AC5));

  Serial.print("DCB1: ");
  Serial.println(digitalRead(DCB1));

  Serial.print("DCB2: ");
  Serial.println(digitalRead(DCB2));
  

  delay(250);

}
GitHub - earlephilhower/arduino-pico: Raspberry Pi Pico Arduino core, for all RP2040 boardsGitHub
Logo
7KB
BBRSumo.zip
archive