Show the QR code on the display and save in a BMP file

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Show the QR code on the display and save in a BMP file

Show the QR code on the display and save in a BMP file

This is an example of QR code encoding using i.MX28. The encoded QR image can show on the LCD display directly using frame buffer and the image saved as a BMP file.

Board : i.MX28EVK

BSP : L2.6.35_1.1.0_130130_source

QR Code Lib:  qrencode-3.4.4.tar.gz

Download from https://fukuchi.org/works/qrencode/

Libqrencode is a C library for encoding data in a QR Code symbol. This library is a free software made by Kentaro Fukuchi.

Build the QR Code Lib source code into rootfs.

1. Create a new folder in <ltib>/dist/lfs-5.1/.

    e.g. <ltib>/dist/lfs-5.1/qrencode

2. Copy the qrencode.spec to this new created folder

3. Build the source code

   ./ltib –p qrencode.spec –m prep

   ./ltib –p qrencode.spec –m scbuild

   ./ltib –p qrencode.spec –m scdeploy

Create and build the application in unit_test:

- I use the existing unit_test package to build my application code.

1. Extract the source code of unit_test

   ./ltib –p imx-test –m prep

2. cd <ltib>/rpm/BUILD/imx-test-2.6.35.3-1.1.0/test

3. mkdir qr_test

4. copy the Makefile and qr_test.c to qr_test folder

5. Build the unit_test

    ./ltib –p imx-test  –m scbuild

    ./ltib –p imx-test  –m scdeploy

After built the code successfully, the qr_test.out will be generated in the unit_test folder.

I start the board with NFS, so I can run the qr_test.out on the board directly.

The command is :

./qr_test.out   (the default QR encode text is “http://www.freescale.com”)

Or input the new text like this :

./qr_test.out –t https://community.freescale.com/community/imx

The QR code  show on the display:

15888_15888.jpgdisplay.jpg

And the BMP files will be generated in the unit_test folder.

15887_15887.pngqr.png

Labels (2)
Attachments
No ratings
Version history
Last update:
‎10-29-2014 12:50 AM
Updated by: