Introduction: Dual Weild MakeyMakey - Even More Inputs!

Picture of Dual Weild MakeyMakey - Even More Inputs!

Sometimes, just one MakeyMakey isn't enough for your project!

Here's how to use two at the same time.

EDIT:
( Ignore this Instructable if you have issues with the drivers, & head to
www.makeymakey.com/remap

Using Chrome, you can remap the keypresses in a web API, simply by following the onscreen instructions!

Very simple, if slightly fiddly. But overall painless. )

Step 1: Are You Sure?

Picture of Are You Sure?

Firstly, are you sure that you need two boards?

The MakeyMakey has extra inputs available, and they add another 5 possible inputs without more than adding a few wires.

I've circled them in green, and by simply adding a few wires they will send the key presses for W A S D F G without having to break out the re programming software.

So suddenly, you have 12 inputs, which might be enough.

However, if you need more, we can add another board.

Step 2: Reprogramming

Picture of Reprogramming

First, you will need the Arduino software IDE. You can get this from www.arduino.cc which is fairly painless.

Hopefully it will install nicely, & you can carry on. (I'm now an hour older, & I'm still waiting for Windows to get to the point.) (It's now beyond a joke, beyond mere farce - don't try this on Windows 7, I beseech you. Go, now, and save your sanity)

Once set up, you should be able to see the MakeyMakey in the IDE dropdown selector for board type. If not, make sure you copied the files specified in the guide to your 'hardware' folder.

Step 3: Connect to the Board

Picture of Connect to the Board

Check you can connect to the board, & that the COM port is set correctly.

Load up the default MakeyMakey sketch, available from a link on Sparkfun:
https://www.sparkfun.com/tutorials/378

Step 4: Here's a Script With the Changes

Picture of Here's a Script With the Changes

Below is the code to change the outputs.

You see, the MakeyMakey is seen as a keyboard and mouse by the computer's operating system, and so what we are going to do is tell one of the devices to send different key presses when touched.

Take a look, it is quite simple. We only need to change the 'settings. h' file, not 'makey_makey'!

The inputs are now going to simulate 0 1 2 3, etc. rather than w a s d f g.


#include "Arduino.h"

/*
/////////////////////////////////////////////////////////////////////////
// KEY MAPPINGS: WHICH KEY MAPS TO WHICH PIN ON THE MAKEY MAKEY BOARD? //
/////////////////////////////////////////////////////////////////////////

- edit the keyCodes array below to change the keys sent by the MaKey MaKey for each input
- the comments tell you which input sends that key (for example, by default 'w' is sent by pin D5)
- change the keys by replacing them. for example, you can replace 'w' with any other individual letter,
number, or symbol on your keyboard
- you can also use codes for other keys such as modifier and function keys (see the
the list of additional key codes at the bottom of this file)

*/

int keyCodes[NUM_INPUTS] = {
// top side of the makey makey board

'1', // up arrow pad
'2', // down arrow pad
'3', // left arrow pad
'4', // right arrow pad
'5', // space button pad
'6', // click button pad

// female header on the back left side

'7', // pin D5
'8', // pin D4
'9', // pin D3
'0', // pin D2
'c', // pin D1
'KEY_RIGHT_SHIFT', // pin D0

// female header on the back right side

'h', // pin A5
'j', // pin A4
'k', // pin A3
'l', // pin A2
'z', // pin A1
'x', // pin A0
};

///////////////////////////
// NOISE CANCELLATION /////
///////////////////////////
#define SWITCH_THRESHOLD_OFFSET_PERC 5 // number between 1 and 49
// larger value protects better against noise oscillations, but makes it harder to press and release
// recommended values are between 2 and 20
// default value is 5

#define SWITCH_THRESHOLD_CENTER_BIAS 55 // number between 1 and 99
// larger value makes it easier to "release" keys, but harder to "press"
// smaller value makes it easier to "press" keys, but harder to "release"
// recommended values are between 30 and 70
// 50 is "middle" 2.5 volt center
// default value is 55
// 100 = 5V (never use this high)
// 0 = 0 V (never use this low


/////////////////////////
// MOUSE MOTION /////////
/////////////////////////
#define MOUSE_MOTION_UPDATE_INTERVAL 35 // how many loops to wait between
// sending mouse motion updates

#define PIXELS_PER_MOUSE_STEP 4 // a larger number will make the mouse
// move faster

#define MOUSE_RAMP_SCALE 150 // Scaling factor for mouse movement ramping
// Lower = more sensitive mouse movement
// Higher = slower ramping of speed
// 0 = Ramping off

#define MOUSE_MAX_PIXELS 10 // Max pixels per step for mouse movement

/*

///////////////////////////
// ADDITIONAL KEY CODES ///
///////////////////////////

- you can use these codes in the keyCodes array above
- to get modifier keys, function keys, etc

KEY_LEFT_CTRL
KEY_LEFT_SHIFT
KEY_LEFT_ALT
KEY_LEFT_GUI
KEY_RIGHT_CTRL
KEY_RIGHT_SHIFT
KEY_RIGHT_ALT
KEY_RIGHT_GUI

KEY_BACKSPACE
KEY_TAB
KEY_RETURN
KEY_ESC
KEY_INSERT
KEY_DELETE
KEY_PAGE_UP
KEY_PAGE_DOWN
KEY_HOME
KEY_END
KEY_CAPS_LOCK

KEY_F1
KEY_F2
KEY_F3
KEY_F4
KEY_F5
KEY_F6
KEY_F7
KEY_F8
KEY_F9
KEY_F10
KEY_F11
KEY_F12

*/

Step 5: Upload

Picture of Upload

You should now be able to upload the modified version of your 'settings.h' file.

Step 6: Plug in the Hardware

Picture of Plug in the Hardware

Plug your two MakeyMakey units in to different USB sockets, & let the drivers install.

You should now be able to press the buttons on one board and get the default key presses, whilst the other board will give you numbers.

Step 7: But I Need More!

Ok, so you may want even more inputs.

Well, if you go back and look at the script that changed the settings on your first board, you will see a line that says

"KEY_RIGHT_SHIFT" // pin D0

This magic keyword actually impersonates the right shift key!

So, you can touch the input to the modified board marked G and then when you press any of the other keys you have set to numbers, you will get symbols instead, just as if you pressed&held shift on a regular keyboard.

The MakeyMakey supports lots of these, & they are listed in the bottom section of the 'settings.h' file you have been modifying.

Step 8: Conclusion

Picture of Conclusion

So at the end of all this, you now have pretty much as many inputs as you could ever need. Just keep reprogramming the boards and plugging them in! (You'll need to keep track of which has been set to what keys!)

Though I've not tried more than three at the same time, the USB specs allow up to 127 devices to be daisy chained, so you are likely to run out of letters before you get that far.

Each board simply types the letter you programmed in to it, and with 3 boards you can have 12 inputs, times 3, so you can simulate enough of a keyboard to get by.


Have fun!

Comments

Apparently changing the title nukes the existing comments! Sorry existing commenters!

About This Instructable

917views

10favorites

License:

Bio: We are a small UK hack/makerspace. Wide and wild variations in interests. This is our official account. Open nights on Wednesdays. See @fzzpop, www ... More »
More by fizzPOP-TheBirminghamHackspace:Table Lamp USB ChargerDual weild MakeyMakey - even more inputs!Raspberry Pi, Internet Radio
Add instructable to: