Ricardo Alves
Published

OpenDarts - Homemade Dartboard Machine

OpenDarts is a software for PC that can connect thorugh an eletronic dartboard via Arduino, Raspberry Pi 2, etc.

BeginnerFull instructions provided1 hour24,202
OpenDarts - Homemade Dartboard Machine

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Generic Electronic Dartboard
×1

Software apps and online services

OpenDarts

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Code

Arduino Firmware

C/C++
Code for connecting Dartboard to PC.
int masterLines = 8; //Change here to the number of lines of your Master Layer
int slaveLines = 8; //Change here to the number of lines of your Slave Layer

int matrixMaster[] = {13, 12, 11, 10, 9, 8, 7, 6}; //Put here the pins you connected the lines of your Master Layer
int matrixSlave[] = {5, 4, 3, 2, A5, A4, A3, A2}; //Put here the pins you connected the lines of your Slave Layer

void setup() {
    Serial.begin(9600);
    Serial.println("OpenDarts"); //This line is not necessary, is just here for debug purposes

    for(int i = 0; i < slaveLines; i++){
        pinMode(matrixSlave[i], INPUT_PULLUP);
    }

    for(int i = 0; i < masterLines; i++){
        pinMode(matrixMaster[i], OUTPUT);
        digitalWrite(matrixMaster[i], HIGH);
    }
}

void loop() {
    for(int i = 0; i < masterLines; i++){
        digitalWrite(matrixMaster[i], LOW);
        for(int j = 0; j < slaveLines; j++){
            if(digitalRead(matrixSlave[j]) == LOW){
                Serial.print(j);
                Serial.print(",");
                Serial.println(i);
                delay(500);
                break;
            }
        }
        digitalWrite(matrixMaster[i], HIGH);
    }
}

Credits

Ricardo Alves

Ricardo Alves

0 projects • 5 followers
Just another developer who wants to rule the world.

Comments