SunFounder FruitKey Manuel utilisateur

Preface
About SunFounder
SunFounder is a technology company focused on Raspberry Pi and Arduino open source
community development. Committed to the promotion of open source culture, we strive to
bring the fun of electronics making to people all around the world and enable everyone to be
a maker. Our products include learning kits, development boards, robots, sensor modules and
development tools. In addition to high quality products, SunFounder also offers video tutorials
to help you build your own project. If you have interest in open source or making something
cool, welcome to join us! Visit www.sunfounder.com for more!
About FruitKey Kit
The SunFounder FruitKey is a USB keyboard-simulating control board designed for Arduino. You
can realize the ’sfunctionswithanArduinoboard.Itcanturnfruits,stairs,
play-doh, animals, tables, leaves, or even a pencil drawing into keyboard or gamepad. Just
connect it to some bananas , you can get a banana piano ;connectitto
some play-doh ,youwillgetagamepad ,andsoon.
The FruitKey is compatible with Arduino Uno, Leonardo, SunFounder Mars, and SunFounder Uno,
thus with one of these boards, we can make the FruitKey work. Here we use the SunFounder
Mars as an example, and other boards works the same way.
Note: You can download the code under LEARN -> Get tutorials on our website
www.sunfounder.com .
Free Support
If you have any TECHNICAL questions, add a topic under FORUM section on our website
and we'll reply as soon as possible.
For NON-TECH questions like order and shipment issues, please send an email to
[email protected]. You're also welcomed to share your projects on FORUM.
SunFounder

Contents
Components List........................................................................................................................................................ 1
What Is It?.....................................................................................................................................................................2
FruitKey + ? = (Keyboard)..............................................................................................................................4
How Does It Work?.................................................................................................................................................... 4
Software Installation..................................................................................................................................................7
Arduino..........................................................................................................................................................................7
Description....................................................................................................................................................................7
Install Arduino IDE.......................................................................................................................................................7
Add the Library......................................................................................................................................................... 10
What Can FruitKey Do?......................................................................................................................................... 12
Test................................................................................................................................................................................12
Simulated Keyboard................................................................................................................................................14
Change Functions of Keys.....................................................................................................................................17
Adjust Touch Sensitivity...........................................................................................................................................20
Adjust Responding Times....................................................................................................................................... 20
Tips.................................................................................................................................................................................21
SunFounder

1
Components List
No. Name Qty. Component
1SunFounderFruitKey 1
2Type-CUSBcable 1
3Type-A M-to-M USB cable
(for FruitKey) 1
4 Dual-head alligator clip cable 10
5 Male-to-Male DuPont wire 10
SunFounder

2
What Is It?
You may have heard about the popular kit named ,inwhichmanystuffsare
used as touch keyboards. There are quite a lot of videos showing how interesting projects it can
make including games, work, etc. In fact, the is a simple circuit board that
makes almost everything an input device for the computer. Therefore, stairs can be used as
piano keys, a banana as a keyboard, some play-doh to make a gamepad, even your family
members to do a synthesizer. It makes our life colorful and full of joy!
Now, what's amazing is that you can also make it with an Arduino board and SunFounder
FruitKey!
The SunFounder FruitKey is a USB keyboard-simulating control board designed for Arduino. You
can realize the ’sfunctionswithanArduinoboard.Itcanturnfruits,stairs,
play-doh, animals, tables, leaves, or even a pencil drawing into keyboard or gamepad. Just
connect it to some bananas , you can get a banana piano ;connectitto
some play-doh ,youwillgetagamepad ; draw buttons on a paper with a pencil
, then you turn this paper into a controller for the Pac-Man .
The SunFounder FruitKey works with the SunFounder Mars, SunFounder Uno, also the official
Arduino Uno and the Leonardo board. The SunFounder Mars is a self-designed microcontroller
compatible with the Arduino Uno in functionality and performance.
Note:Here we take the SunFounder Mars as an example, and other boards work the same
way.
SunFounder

3
The SunFounder Mars adopts also the ATMEGA328P as the processor, the same Optiboot
bootloader as Uno. And it has 14 digital I/O pins and 6 analog inputs and is featured with a
32KB program storage and 16MHz crystal oscillator and so on.
Multiple features make it unique: beautiful red PCB, parallel yellow and red pins, and a
beautiful red appearance. In technology, it uses FTDI232R for USB-to-serial and adopts Type-C,
the only USB port so far that supports reversible plug orientation. All the I/O ports are made with
two pins (male and female) in a row, for free to use – you can just plug Dupont wires regardless
of M or F.
A 5V power switch is added to control the board power, which may be expected by mass
hobbyists – you can switch off the board when it’s not in use, so as to avoid frequent plugging.
In addition, a reset button is set at the board side for operational convenience. To save space,
the ATmega328P Microcontroller is packaged in patch.
Together with SunFounder Mars, the FruitKey can be a simulated keyboard which is almost
"omnipotent".
SunFounder

4
FruitKey + ? = (Keyboard)
The FruitKey works on any conductive objects. You can also spray some water on the object’s
surface to make it work.
Preferred objects: banana, lead pencil, ketchup, lemon, and other plant; coin, jelly, cat (or
dog, etc.), or, human being.
How Does It Work?
As long as the object is conductive, the FruitKey can work with it. The principle is that a
single-chip microcomputer simulates some keys on a keyboard, and circuits will be connected
by a touch rather than a switch.
The SunFounder FruitKey uses a touch as the input signal. It adopts two-point touching switch.
The alligator clip cables are connected to the touching end and ground on the board, while
connected to the anode and cathode on the other end. When someone touches the anode
and cathode as a resistor, currents will flow through the power to ground on the board. Thus
the current value can be detected, then the touch.
Let your imagination go wild and turn anything into a keyboard!
SunFounder

5
Connect the FruitKey to two objects by alligator clips, such as your fingers and a lemon .
When you touch the when holding the other clip, an electric circuit is generated. Then
the FruitKey will send a signal – key pressed – to the computer via Mars, which be considered as
a real keyboard by the computer. The FruitKey can run on any programs or webpages.
The schematic diagram of the FruitKey:
SunFounder

6
Connect the six touch points A0-A5 of the FruitKey to 5V of Mars with a 1M pull-up resistor
between each. If there is no touch, A0-A5 are High level by default (that is, the default value of
A0-A5 is 1023). Since each of the six points is connected to a 0.1μF ceramic capacitor
respectively, when you touch the GND and one or two of A0-A5, the corresponding capacitor
will discharge, and the input voltage will be reduced, thus the input AD value.OncetheAD
value decreases to the threshold, it can be considered that the corresponding touching pad
has been triggered. Besides, we can connect six LEDs to digital pin6-pin11 as the signal
indicators for A0-A5 separately.
SunFounder

7
Software Installation
Note:
Before starting your own project, you must download the file FruitKey V1.0 for Arduino.zip on our
official website by visiting LEARN -> Get Tutorials -> FruitKey V1.0 for Arduino and unzip it.
Arduino
Description
Arduino is an open source platform with simple software and hardware. You can pick it up in
short time even if you are a beginner. It provides an integrated development environment (IDE)
for code compiling, compatible with multiple control boards. So you can just download the
Arduino IDE, upload the sketches (i.e. the code files) to the board, and then you can see
relative experimental phenomena. For more information, refer to http://www.arduino.cc.
Install Arduino IDE
The code in this kit is written based on Arduino, so you need to install the IDE first. Skip it if you
have done this.
Step 1: go to the arduino.cc website and click Download.Onthepage,checkthesoftwarelist
on the right side under Download the Arduino Software.
Find the one that suits your operation system and click to download. There are two versions of
Arduino for Windows: Installer or ZIP file. You're recommended to download the former.
SunFounder

8
Step 2: Double click the exe. file and the following window will show up. Click IAgree.The
following interface will show up.
Choose Next.
Click Browse to choose the installation path or enter a directory at the Destination Folder.
Click Install.
SunFounder
Table des matières
Manuels Carte mère populaires d'autres marques

Telit Wireless Solutions
Telit Wireless Solutions SL869-3DR Manuel utilisateur

Gigabyte
Gigabyte GA-9IVDT Manuel utilisateur

Texas Instruments
Texas Instruments ADS8372EVM Manuel utilisateur

Commell
Commell MS-C73 Manuel utilisateur

IBT Technologies
IBT Technologies MB860 Manuel utilisateur

Nvidia
Nvidia TEGRA DG-04927-001_V01 Manuel utilisateur











