In this tutorial, we'll go through how you can use Python to encode text into a QR Code and display it on the Onion Omega's OLED Expansion.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
We will need to have support for git, Python, and the Onion OLED Expansion Python Module.
opkg update
opkg install git git-http python-light python-codecs pyOledExp
Now we need to download the Python code that actually does all the work:
cd /root
git clone https://github.com/OnionIoT/oledQrCodeGenerator.git
Now we have to make some QR codes! Navigate into the repo directory:
<span class="hljs-built_in">cd</span> oledQrCodeGenerator
And run the program, the argument to the script is the text that will be encoded in the QR code pattern:
root<span class="hljs-variable">@Omega-18C2:</span>~/oledQrCodeGenerator# python main.py <span class="hljs-string">'Wow, my first QR Code'</span>
> Encoding <span class="hljs-number">21</span> characters<br>> Generated QR <span class="hljs-attribute">Code</span>: <span class="hljs-number">31</span>x31 pixels
> Doubled QR Code <span class="hljs-attribute">size</span>: <span class="hljs-number">62</span>x62
> Initializing display
> Setting display mode to inverted
> Writing buffer data to display
This will encode the data and display the resulting QR code on the OLED Expansion:
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates