Microduino-Joypad Getting started

Hardware building

If you are not familiar with Microduino, please refer to:  Microduino_Getting_start,  otherwise, go ahead.

  • Required modules
Module Quantity Function
Microduino-Joypad 1 controller
Microduino-Core 1 core
Microduino-USBTTL 1 download code
  • Other hardware
Equipment Quantity Function
USB data cable 1 Data transmission
Battery case 1 Load cell
AAA batteries 3 power supply

Microduino-Joypad Schematic:Microduino-Joypad-sch.zip

Step 1: Install Microduino-TFT on Microduino-Joypad panel;

Step 2: Install the nylon screw on Microduino-Joypad

Step 3: Stack the Microduino-USBTTL and Microduino-Core on Microduino-Joypad

Step 4: Connect the Microduino-TFT and Microduino-Joypad with wires. 

Step 5: Fastened the panel and baseboard with nylon screw.

Step 6(Optional): Please install vibrate motor as needed.


Step 7: Install battery box on the baseboard, there’s sign of plus or minus on the back of the baseboard,

please stick the  foam board on the bottom of Joypad.

Step 8: You may turn on the power switch to check the battery function.

Addition:  For Microduino-Joypad-Game installation, please take off the right rocker bar first.

and connect the panel jack with baseboard jack 

and then screwed the panel 

 

Test

  • 2 parallel Upin27 bedframes
  • 2 waved switchs
  • 4 buttions
  • Detect MIC sound input
  • Detect photosensitive input
  • Buzzer output, connected to Microduino D6 pin
  • Vibrate motor output, connected to Microduino D8 pin
  • Onboard Microusb power supply, charge management, 3.3V stabilization
  • 2.54 spacing battery powered interface
  • Download Library:
  • library needed
    • Please make sure installed Microduino hardware support Package and library support package inMicroduino_Getting_start
    • please make sure there are _01_Microduino_TFT library and _08_Microduino_Shield_Joypad library in Ardino\arduino-1.0.6\libraries Folder.
  • debug:
    • Prepare:Microduino-USBTTL、、Microduino-Core、Microduino-Joypad
    • software:library support package、Arduino IDE;
    • unzip library support package,copy to libraries Folder in Arduino IDE;
    • re-open “Arduino-IDE”,you can choose example of “_08_Microduino_Shield_Joypad\examples”,Compiled by the board select Microduino Core (Atmega328P @ 16M, 5V), can be downloaded directly;

Program Specification: 

  • read:
    • read lightsensor, MIC,  IntA, IntB,returned value:int(0~1023);
//lightsensor———————-

       Joypad.readLightSensor();
Joypad.readMicrophone();
       //MIC--------------------
//INTB———————-
       //INTA----------------------

       Joypad.readIntA();
Joypad.readIntB();
  • read left and right Joystick X & Y,returned value:int(-512~512);
//left joystick—————-

       Joypad.readJoystickX();

//right joystick—————-
       Joypad.readJoystickY();

Joypad.readJoystick1Y();
       Joypad.readJoystick1X();
  • read left, right Joystick;switchs、4 buttons,returned value:Boolean(HIGH、LOW)
Joypad.readButton(byte ch);
//left joystick—————-

              JOYSTICK_UP;
JOYSTICK_LEFT;
              JOYSTICK_DOWN;
//left joystick press down————
              JOYSTICK_RIGHT;
//right joystick—————-
              CH_JOYSTICK_SW          


              JOYSTICK1_UP;
JOYSTICK1_RIGHT;
              JOYSTICK1_DOWN;

              JOYSTICK1_LEFT;
//switch——————
       //right joystick press down------------

              CH_JOYSTICK1_SW


              CH_SWITCH_L;
CH_SWITCH_2;
              CH_SWITCH_R;
             

       //4 buttons------------------

              CH_SWITCH_1;


              CH_SWITCH_3;
CH_SWITCH_4;
  • read in:
    • Control buzzer, vibrate;
//==========================
//buzzer———————
Joypad.tone(unsigned int freq);
Joypad.tone(unsigned int freq, unsigned long duration);

  Joypad.noTone();



//vibrate------------------------

“unsigned int motor_vol”:Vibration strength
Joypad.motor(unsigned int motor_vol);

Application

Microduino-Joypad tutorial

Related Post

Somatosensory Birthday Music Box

Somatosensory Birthday Music Box

The music box keeps playing the Happy Birthday to You all the time. Left-leaning, it will speed up playing. Right-leaning,…

Leave a Reply

Your email address will not be published. Required fields are marked *