© 2024 EasyEDA Some rights reserved ISO/IEC
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
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
STD 5 Button Keyboards
Mode:
#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
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
Loading...
Do you need to add this project to the album?