# 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="https://2251603990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUEpKUKA4iMi1RRhp4nJB%2Fuploads%2FH5J1rLmFJSYKwGadQ2Ro%2FPicoSettings.png?alt=media&#x26;token=bd6c5bbd-a787-4b5d-ae89-489ae97e24a2" alt=""><figcaption></figcaption></figure>

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

{% file src="<https://2251603990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUEpKUKA4iMi1RRhp4nJB%2Fuploads%2FljjQTgdCOoyu1uVub3v0%2FBBRSumo.zip?alt=media&token=ad0d49cf-357f-42a4-a46f-08072c01fda9>" %}

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);

}

```
