# Arduino

{% hint style="info" %}
This is an advanced feature, the setup of Arduino is outside of the scope of this documentation. Basic information is provided.
{% endhint %}

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

{% embed url="<https://github.com/earlephilhower/arduino-pico>" %}

Follow the install instructions from the above site.

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

<figure><img src="/files/hczIDKqi0T8FVJuJjE1N" alt=""><figcaption></figcaption></figure>

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

{% file src="/files/VLis1WTqWjP1j0qsDZvM" %}

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

```cpp
#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:

```cpp
#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);

}

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sumokit.buildingblockrobotics.com/tips/arduino.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
