Keyboard Shortcut, Qwiic Keypad

Pages
Contributors: santaimpersonator
Favorited Favorite 2

Project Notes

This is the end of the project documentation, excluding the resources linked below. Here are a few notes I had following the completion of the project tutorial.

CircuitPython

Unfortunately, this was my first time using CircuitPython and there was a little confusion getting everything working. Specifically, I am not sure if I implemented the I2C functionality properly (as intended) for CircuitPython, but it worked for the purpose of this project. Feel free to comment below on any changes that should be made.

In my initial attempt to get the Qwiic Keypad running, I was able to read from all the registers. However, I wasn't able to implement a write to set individual register values in a similar fashion using the writeto function. It wasn't until I looked at how the code was operating with a logic analyzer, that I realized that these functions operated at a lower level. Despite being able to read a whole register block, the functions actually were meant for read and write bit operations as demonstrated above.

language:python
try:
    #initial attempt
    result1 = bytearray(8)
    i2c.readfrom_into(i2caddress, result1, start=0, end=7)
    print(result1)
    time.sleep(3)

finally:
    i2c.unlock()

Going Further with Macros

Do you have a repetitive task that you perform daily on your computer that you wish to automate? If you are more computer savy, you may already use or have created your own simple macro for more complex tasks that can't be handled with a mere keyboard shortcut or hotkey. Although we won't cover macros in this guide, they are simple, yet powerful tools.

How simple...

Even a grade schooler, could easily use Microsoft Excel to record a custom macro in VBA.

How powerful...

Macros can perform essentially, almost any function you can with a mouse and keyboard. If you are particularly diabolical, this is an easy way to prank your friends... you could easily create and hide a macro to cause mouse movements or play a particular audio file randomly. However, please be aware of the security risks involved in using macros (see note below).

Danger: When enabled, macros, although useful, may open up your computer to security risks. In the past macros, have been known to be exploited as security flaws to access computers for private information. Please make sure to research the risks thoroughly before using or enabling macros on any computer.