![]() ![]() Then for the loop we just need to check if the button has been pressed using a digitalRead() on the button pin. Finally we need to start the communication with the computer, so that it recognizes the Arduino as a "keyboard" so we can send key commands. Then we set the color of the LED to the on color set above. Google has a color picker that will give you the values of any color.įor the setup first we setup our in/out pins, in for the button and out for the LEDs. They can be changed easily by just entering the RGB value of the color you want. The first few lines are just defining the on/status colors. The whole top section is defining some values to be used through out the code, first the pins, the buttons and each LED color get a pin, these can be adjusted if you need. The program is fairly simple, it is basically just a diversion of the Keyboard.h example and the RGB LED example, just kinda chopped up and smushed together. Now its time to plug in the Arduino and load up the program. ![]() Updates will also need to be made to the code. On the Pro micro they are the pins with circles around them. If you want to change the LED pins make sure that you attach them to a PWM pin on the Arduino. Solder the other ends of the wires to the correct pins on the Arduino.Solder the button wire onto the other button lead.Solder the ground wire to the button lead and LED ground lead.now bend the LED ground lead down to meet one of the button leads. With the LED soldered onto the resistors put the LED and button into the solder guide printed in the last step.Once you have your LED type figured out solder the LEDs to the right resistors.It is just to make sure that none of the wires shift and short out. If you are using heat shrink, it will cover the connection between the wire, resistor, and LED.Clip the ends of the resistors fairly sort, maybe about 10mm longs or long enough that you feel comfortable soldering too.To start with strip the ends of 5 wires, the wires I use came from an old computer ribbon cable.I have only made this with a common cathode LED. If you need to apply the ground to the longest lead you have a common cathode, if you need to apply the voltage to the longest lead and ground any of the other leads you have a common anode. Note here that I have a common cathode LED, if you have a common anode LED your pin layout will be different to find out which you have, either look at the package, if you have it, or try and plug it in to a voltage source. The RGB has 4 leads, one for each color and one for ground. I think that this is the most confusing part. This step is to actually get all of the parts of the circuit together. You could use what ever case you want for this, but remember it will be something that you rest your foot on to use it. Also on the version I made I used 330 Ω resistors on all, this does mean that the red is much brighter than the other colors.Ī note on the case: I used a 3D printer to make a case as I found that to be the easiest. A micro controller that uses that chip should work (I used a knock off and it works fine). The Pro Micro uses the MEGA32U4 chip which works great with the keyboard.h library to make the code really simple. USB micro cable, long enough to reach the floor*Ī note on the Arduino selection.Arduino Pro Micro - a knock of will work as long as it uses the MEGA32U4 chip.The first and most important step in any project is gathering your materials and tools, unless you want to be cursed to be wandering around looking for that one tool you need every 2 minutes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |