Difference between revisions of "Key-press"
(→Debugging) |
(→Debugging) |
||
Line 92: | Line 92: | ||
[[File:mixly_board_COM.jpg|400px|center]] | [[File:mixly_board_COM.jpg|400px|center]] | ||
Step2:Open the serial monitor. | Step2:Open the serial monitor. | ||
− | [[File:mixly_COMXX.jpg| | + | [[File:mixly_COMXX.jpg|600px|center]] |
Step3:Make sure the serial baud rate is the same with the pre-set one. | Step3:Make sure the serial baud rate is the same with the pre-set one. | ||
− | [[File:mixly_COMXX_ok.jpg| | + | [[File:mixly_COMXX_ok.jpg|600px|center]] |
Step4:Short press the key once and you'll see "ON' printed in the serial monitor. Press down again and you'll see "OFF" printed. | Step4:Short press the key once and you'll see "ON' printed in the serial monitor. Press down again and you'll see "OFF" printed. | ||
[[File:mixly_Serial_boolean.jpg|600px|center]] | [[File:mixly_Serial_boolean.jpg|600px|center]] | ||
+ | |||
==Extension== | ==Extension== | ||
By changing the serial port print to the colored lights, you can DIY a little desk lamp. | By changing the serial port print to the colored lights, you can DIY a little desk lamp. | ||
|} | |} |
Revision as of 14:21, 23 March 2016
ContentsFunction of the Module
Equipment
Example 1: Long-press & Short-press FunctionOverviewTo detect the key is long pressed or short pressed, which can be distinguished by checking the returned results in the serial monitor. Hardware Buildup
Mixly Programming
DebuggingStep1:Select the right board card(Core USB 32U4) and COM port(Recognized automatically by default). Step2:Open the serial monitor. Step3:Make sure the serial baud rate is the same with the pre-set one. Step4:Short press or long press the key and you'll see "short" or "long" pressed in the serial monitor every 1s. Experiment 2: State Turnover FunctionOverviewEach time you press down a key, the status will turn over once. Like a desk lamp, when you press down, it turns on. And press one more time, it'll turn off. There're only two states. We can see the result through the serial monitor. Pressing down means "ON" (print "ON" in the serial monitor)and one more time, means "OFF"("OFF" printed in the serial monitor). Hardware Buildup
Mixly Programming
DebuggingStep1:Select the right board card(Core USB 32U4) and COM port(Recognized automatically by default). Step2:Open the serial monitor. Step3:Make sure the serial baud rate is the same with the pre-set one. Step4:Short press the key once and you'll see "ON' printed in the serial monitor. Press down again and you'll see "OFF" printed. ExtensionBy changing the serial port print to the colored lights, you can DIY a little desk lamp. |