Multi-Control

From Wiki
Revision as of 10:29, 25 April 2017 by Root (Talk | contribs)

Jump to: navigation, search

Introduction

L1.jpg

SunFounder Multi-Control is a multi-function controller based on the Atmel ATmega32U4. With a mini USB port, it can be connected to the PC or Raspberry Pi directly.
After powering, the PWR (power) LED keeps constant lighting. Press any key and the TX LED will blink, which indicates the key data has been sent.
There are 6 silica gel buttons and a joystick to simulate a gamepad, a reset switch, and a mode toggle switch (for touch terminals) on the controller. Besides the buttons, there are 4 GND ports and another 10 analog touch input ports for simulating the midi devices .
On the back of the board, there are 2 groups of pin headers including one group of GND, and the other corresponding to the input of the 10 keys. They are reserved for extending more control functions.
There is an ICSP 6-pin header to write bootload to the chip and a mini USB port to upload the control program.
Functions:

Wiki.png

The SunFounder Multi-Control can simulate the gamepad, midi input device, and PC keyboard.
In the gamepad mode, the operation is the same as using a general gamepad and quite suitable for the RetroPi games.
In the midi mode, it is used with alligator clip cables. One clip at a cable end bites the GND hole on the board and one at the other to the user. More clips connect the holes to conductors and the user inputs midi signals by touching the conductor (s). The operation and principle are quite similar with the Fruitkey developed by SunFounder.
In the keyboard mode, the joystick acts the same as the up, down, left, and right arrow keys on the keyboard. Each button maps with a key. By default, A to left Ctrl, B to left Alt, X to Z, Y to X, SELECT to Space, and START to Enter. You can self-define the key mapping by modifying the key value in the header file.
Mapping between key IOs in the board and Arduino IOs:



Features

1.Small size: 120 x 50 x 32 mm
2.Fixing Hole: M3, sizing 113mm (H) x 31mm (V)
3.Communication with the master via mini USB
4.Supply Voltage: 5V (powered by USB)
5.With 6 buttons, 1 joystick, 10 touch contacts, 10 pin headers (6 share the same IO ports with the buttons)
6.Contains 1 ICSP pin header, 1 Reset switch, and 1 Mode toggle switch.

Test

Add Library

An Arduino library is needed when using the joystick.
Open Arduino IDE, select Sketch->Include Library->Manage Libraries

L2.png

Search for joystick in the pop-up window. And click Install to add the library.

L3.jpg

Or click Add .ZIP Library to load the zip file in the code package.

Upload the Code

There are three Arduino code folders in the code package download, including joystick, keyboard, and midi. When you upload a program to the Multi-Control, it can realize the specific function.

L4.png

Take the following procedures.
Choose the board: Tools ->Board->Arduino/Genuino Uno.

L5.png

Then select Tools ->Port and select the port you just checked on Device Manager.

L6.png

Click the Upload icon to upload the sketch to your board.

L7.png

Wait till it’s done.

Check the Device

L8.png

There is a new game controller for Arduino Leonardo under the Devices, which indicates the simulated joystick of Multi-Control has been connected to the computer. Right click on it, on the pop-up menu click Set game controller->Property. Then push the stick or press any key to see the test result.

L9.pngL10.png
L11.png

Joystick

In the joystick mode:

L13.jpg

After uploading the code of joystick to the board, connect Multi-Control to Raspberry Pi with a USB cable.

Keyboard

In the keyboard mode:

L13.jpg

You can play many games by using just a few buttons, Multi-Control with key mapping is enough for it. Similarly, upload the code of keyboard to multi-control. Then connect it to the computer via USB and it can then be used as a keyboard for simple games.

Modify the Key Mapping of the Board

To change the key mapping of the Multi-Control, you can modify the header file keymap.h in the keyboard folder.

L14.png

Midi

Use the alligator clip cables to make a midi device. One clip at a cable end bites the GND hole on the board and one at the other to the user. More clips connect the holes to conductors and the user inputs midi signals by touching the conductor (s).
A midi player is needed here, and a software named VMPK for computers and mobile devices is recommended here. You can also use other similar midi player apps.

Change the Instruments under Midi

You can change the instruments that midi simulates by modifying the midi.ino file.

L16.png

Modify the Musical Scale:

L17.png