Editor Version ×
Standard

1.Easy to use and quick to get started

2.The process supports design scales of 300 devices or 1000 pads

3.Supports simple circuit simulation

4.For students, teachers, creators

Profession

1.Brand new interactions and interfaces

2.Smooth support for design sizes of over 5,000 devices or 10,000 pads

3.More rigorous design constraints, more standardized processes

4.For enterprises, more professional users

Ongoing

STD 5 Button Keyboards

License:

Mode: Editors' pick

  • 1.2k
  • 0
  • 1
Update time: 2021-04-11 04:25:27
Creation time: 2015-12-19 15:04:14
Description
## Arduino drives 5 button keyboard ## 5 button keyboard: the use of series resistor and switch to determine the various voltage to be sent to a Arduino analog input.You can use the same technology to install multiple buttons in other ways or directions. ## 5 button keyboards CODE ##


#define keyboard_AnalogInput 5

#define btRIGHT  0
#define btUP     1
#define btDOWN   2
#define btLEFT   3
#define btENTER 4
#define NONE   5

int ad_keyd = 0;
int buttonPressed;

void setup()   
    {
  Serial.begin(9600);
  Serial.println("5 button keyboards");
     }

void loop()  
{
  buttonPressed = read_keyboard();
  if (buttonPressed != NONE)
  { 
     Serial.print("OK easyeda pressed ");
    Serial.println(buttonPressed, DEC);
    } 
  delay(500);
}
// read the buttons
int read_keyboard()
{
   ad_keyd = analogRead(keyboard_AnalogInput); 
  // these values: 0, 144, 329, 504, 741
  if (adc_key_in > 1000) return NONE; 
  if (adc_key_in 
Design Drawing
schematic diagram
1 /
PCB
1 /
The preview image was not generated, please save it again in the editor.
ID Name Designator Footprint Quantity
1 KEY K1,K2,K3,K4,K5 NONE 5
2 330 R1 R3 1
3 620 R2 R3 1
4 1k R3 R3 1
5 3.3k R4 R3 1
6 2k R5 R3 1
7 Arduino MEGA 2560 U1 DIP 1

Unfold

Project Attachments
Empty
Project Members
Target complaint
Related Projects
Change a batch
Loading...
Add to album ×

Loading...

reminder ×

Do you need to add this project to the album?

服务时间

周一至周五 9:00~18:00
  • 0755 - 2382 4495
  • 153 6159 2675

服务时间

周一至周五 9:00~18:00
  • 立创EDA微信号

    easyeda

  • QQ交流群

    664186054

  • 立创EDA公众号

    lceda-cn