loading

For those of you who have not used a Makey Makey before, they are essentially PIC boards with some additional clever really sensitive electronics which can detect a short circuit, even when conducting through a person (or their typical example some fruit). They natively interface with the computer as a keyboard and mouse, so it is really easy to interface it with existing applications.

Knowing this, I thought I would write a custom Qt application as my Quiz interface, and use the Makey Makey to interact with each of my players. Essentially, when one of the players hits their button, it will bring up a message and lock out all other player from pressing their button. That way you will know who pressed their button first so you know who gets to answer the question first.

Step 1: Each Player

Each of the players needs 2 wires, one wire carrying the button that they are pressing and one with the ground (labelled EARTH on the Makey Makey board).

I found some two core wire, which I stripped back on both ends, then carefully using wire stripper also stripped the inner cores revealing the copper.

Step 2: Wiring to the Makey Makey

As all users need a button wire and a ground wire, I decided that blue would be my ground and twisted them all together. I then soldered and trimmed down all of the wires ready for putting onto the board. Fortunately the Makey Makey has nice big pads to solder to, so it was really easy to solder it all together. The blue when to the bottom of the board and all the red wires to the up, down, left & right button. I ran all the wires to the left of the board, so that they could be neatly taped together.

Step 3: Creating the Buttons

So that each user can press their buttons as hard as they like I decided to tape a few bits of copper tape down to the table. Now essentially each user can hit the table (ideally centrally over the tape) to activate themselves in the Quiz engine on the computer. Unlike conventional buttons (which I have used in the past for these sorts of thing) it does not matter how hard you hit the table, so long as you don't break the table or tug on the wires. This means when people get a bit too enthusiastic when they have the answer they are not going to break my buttons again.

I just used a bit of masking tape and a sticker over the soldered ends so that the wire does not put too much strain on the tape.

Step 4: Round Reset

To reset between rounds I inserted a conventional button to the space bar. Now you can either hit the space key on the computer, or you can toggle the switch on the Makey Makey to reset who the winner is.

Step 5: The Qt Quiz Software

I created the Quiz Engine with Qt Creator (community edition) which is a quick and easy way to create C++ GUI applications in Windows, but also works well on Mac and Linux.

The code essentially saves the string of the winner into a gameWinner QString (so everyone's name needs to be unique). As soon as that is set, no other user can overwrite that QString until the system is reset with the space key. I have attached a zip of all the source code, but just so you can glance through I have included the mainWindow header and C++ source files below.

The GUI is currently very basic, but I intend to eventually add the ability for player's names to be adjusted and also include the photo of the Winner of that round. Another improvement would also be to have a runner up show, in case the Winner answers the question incorrectly.

mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include 
#include 

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void keyPressEvent(QKeyEvent *event);
    
private slots:
    void on_reset_clicked();

private:
    Ui::MainWindow *ui;
    QString gameWinner;
};

#endif // MAINWINDOW_H
mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include 

#define PLAYER1 "Dan"
#define PLAYER2 "Divya"
#define PLAYER3 "Diana"
#define PLAYER4 "Jack"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->setFocusPolicy(Qt::StrongFocus);
    qDebug() << "Launching SpyClub Quiz Engine";
    gameWinner = "";
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::keyPressEvent(QKeyEvent *event)
{
    if(((event->key() == Qt::Key_Up) ||
        (event->key() == Qt::Key_Right) ||
        (event->key() == Qt::Key_Down) ||
        (event->key() == Qt::Key_Left)) &&
        (gameWinner == ""))
        gameWinner = "TBC";

    switch(event->key())
    {
        case Qt::Key_Up:
            qDebug() << PLAYER1;
            if(gameWinner == "TBC") gameWinner = PLAYER1;
            break;
        case Qt::Key_Right:
            qDebug() << PLAYER2;
            if(gameWinner == "TBC") gameWinner = PLAYER2;
            break;
        case Qt::Key_Down:
            qDebug() << PLAYER3;
            if(gameWinner == "TBC") gameWinner = PLAYER3;
            break;
        case Qt::Key_Left:
            qDebug() << PLAYER4;
            if(gameWinner == "TBC") gameWinner = PLAYER4;
            break;
        case Qt::Key_Space:
            qDebug() << "Game Reset!";
            gameWinner = "";
            break;
    }

    if(gameWinner != "") ui->status->setText(gameWinner);
    else ui->status->setText("No Winner Yet...");
}

void MainWindow::on_reset_clicked()
{
    qDebug() << "Game Reset!";
    gameWinner = "";
    ui->status->setText("No Winner Yet...");
}

Step 6: Finished System

So here it is, everyone sits at one end of the table with the Quiz master on the other with the laptop. The Makey Makey is intentionally left visible, so that when people press their button an LED light's up to show that their button press has been acknowledged. Hope you enjoyed version 0.1 of my quiz system, I am sure it will be improved upon but I'm off to go have a quiz night :D

<p>Thank you very much for posting this. I'm making somethinig very similar and needed the runner up. I've forked your code at added the needed bits for &quot;runner up&quot;. It's not pretty, but it works enough...</p><p>https://github.com/shaiss/MakeyMAkeyQuiz/</p>

About This Instructable

1,325views

5favorites

License:

Bio: Space Technology and Planetary Exploration Engineering, working in development for Magna Parva Ltd. Also a proactive member of St John Ambulance and volunteer for various ... More »
More by spyclub:Creating Vinyl Stickers Arduino Controlled Electric Candle Makey Makey Electronic Melodica 
Add instructable to: