Skip to main content

Posts

Showing posts with the label Coding

Controlling an Arduino MCU using a keyboard

I find it sometimes useful to be able to control digital output pins on an Arduino using my computer keyboard when doing projects. It allows for quick and easy testing (i.e. toggling relays...) before writing any more control coding. Making use of the Processing and Arduino languages, it is possible to send bytes of data over the Arduino's serial port.  First, why use Processing instead of any other language? Since Processing is a very user friendly language and has some backwards compatibility with Java, it is the perfect environment for writing small pieces of code without having to worry about the headaches of compiling and running codes. Additionally, it uses the same light weight IDE as Arduino making it simple to use.  Second, why even use Processing? Arduino deals with the programming of the on board microcontroller, rather than listening for keyboard inputs from your computer. Solving this problem is simple by writing a program that listens at the software level of you...