Hi,
Can we please have a circuit diagram?
An image of a hand drawn schematic will be fine, include ALL power supplies, component names and pin labels.
How have you got your button wired?
If between pin 6 and 5V, have you got a 10K pulldown resistor from pin 6 to gnd?
If between pin 6 and gnd, have you got a 10K pullup resistor from pin 6 to 5V?
Have you looked at the keyboard library example?
There should be a
Keyboard.begin();
and a
Keyboard.write
statement, view the example and run it to find out how it works.
For now, i know that button 6 works.
This is because when I run the code I wrote above, button 6 keeps pressing x even though it's only pressed once.
Keyboard.write only presses x once, so we've used a press that keeps on pressing. What we want to do is press x for 4 seconds, release for 1 second, press x for 4 seconds, and so on and so forth.
Note with those button modules I assume, you press the button, pin 6 will go HIGH so your logic needs to be reversed as I have edited in the above code.
Hi,
Explain button pressed ONE TIME?
Do you mean just momentarily press it and the x's will be sent for 4 seconds JUST once and if the button is held down will repeat and repeat with 1 second gaps?
Thank you again for your hard work, it is greatly appreciated. Thank you.
To be exact,
Press button 6 once ();
{
Press X for 4 seconds
Release the button for a second.
Press X for 4 seconds
Release the button for a second.
Press X for 4 seconds
...
...
...
}