Difference between revisions of "Microduino Rotary encoder controls computer"
(→Video) |
(→Outline) |
||
Line 4: | Line 4: | ||
| | | | ||
==Outline== | ==Outline== | ||
− | *Project:Microduino encoder controls | + | *Project:Microduino encoder controls computer |
*Objective:Use the Microduino-32U4 and rotary encoder to simulate the keyboard. Press it to simulate the "Ctrl+tab", and rotate it to move the windows (up and down). | *Objective:Use the Microduino-32U4 and rotary encoder to simulate the keyboard. Press it to simulate the "Ctrl+tab", and rotate it to move the windows (up and down). | ||
*Difficulty:Higt | *Difficulty:Higt |
Revision as of 01:57, 17 March 2015
Language: | English • 中文 |
---|
ContentsOutline
Bill of Materials
DocumentDownload Microduino firmware package: http://www.microduino.cc/wiki/index.php?title=%E5%AE%89%E8%A3%85Arduino_IDE_Microduino%E7%A1%AC%E4%BB%B6%E6%94%AF%E6%8C%81%E5%8C%85 Download test program: https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Advanced_Tutorial/Microduino_32u4_KEY Debug
Program explanationUse Arduino's USB library to relize the keyboard data input. 1.Function "Keyboard.write();" means that only press key one time. Function "Keyboard.press()" means that always hold the key, to cooperate with function "Keyboard.releaseAll()" used together; 2.Input case alphanumeric directly and use single quotation to mark. For example, input character "M":"Keyboard.write(‘M’);". Input special key, you can find the key nambe in file "hardware\arduino\cores\arduino\USBAPI.h", if you want to input "enter", just like this:"Keyboard.write(KEY_RETURN);". 3.Read the I/O port voltage to judge the if the encoder was pressed which use to simulate the "Ctrl+Tab". 4.Use the interrupt to judge the directory of encoder, then choose the value. We have changed the firmware, so you need download Microduino's firmware package. 5.doEncoder() use to simulate the up and down key. 6.In main function to judge if the encoder was pressed to simulate "Ctrl+Tab". ResultRotary encoder simulates the keyboard to relize the un and down key. Press the encoder to simulate the "Ctri+tab". You change the key value to finish other experiment. Pay attention issue
Video |