久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

立即注冊 登錄
返回首頁

uid:197280的個人空間

日志

STM32二維碼

已有 4094 次閱讀2017-5-6 13:40 |個人分類:stm32| 二維碼

實(shí)驗(yàn)環(huán)境

硬件:STM32板 (STM32F207 )

     LCD12864 模塊 (ST7565)

USB轉(zhuǎn)串口模塊 TTL

     ST-Link V2 調(diào)試

軟件:MDK Keil v5.12

     PortHelper.exe 串口調(diào)試助手

實(shí)驗(yàn)?zāi)康?/p>

     在嵌入式平臺上生成QR Code,LCD顯示

實(shí)驗(yàn)步驟:


  1. 建立STM32工程,包括LCD顯示或串口打印,使用MicroLIB

  1. 在https://github.com/fukuchi/libqrencode 下載源碼 添加主文件夾下的 .h .c文件到工程,qrenc.c 不要添加
  2. 對所有.C文件做如下修改

    #if HAVE_CONFIG_H

    # include "config.h"

    #endif

    改為

    # include "config.h"

    添加 config.h文件,添加如下信息

/* Define to 1 if you have the `strdup' function. */

#define HAVE_STRDUP 0

 

/* Major version number */

#define MAJOR_VERSION 3

/* Micro version number */

#define MICRO_VERSION 0

/* Minor version number */

#define MINOR_VERSION 9

 

/* Define to the version of this package. */

#define PACKAGE_VERSION "3.9.0"

 

/* Version number of package */

//#define VERSION "3.9.0"

#define LIBQRENCODE_VERSION "3.9.0"

 

/* Define to empty if `const' does not conform to ANSI C. */

/* #undef const */

 

/* Define to `__inline__' or `__inline' if that's what the C compiler

calls it, or to nothing if 'inline' is not supported under any name. */

#ifndef __cplusplus

/* #undef inline */

#endif

 

/* Define to 'static' if no test programs will be compiled. */

#define __STATIC

#define WITH_TESTS 1

  1. 在Main.c中添加測試代碼

#include "qrencode.h"

#include "qrspec.h"

#include "mqrspec.h"

#include "bitstream.h"

#include "qrinput.h"

#include "rsecc.h"

#include "split.h"

#include "mask.h"

#include "mmask.h"

 

QRcode*qrcode; //最后結(jié)果

 

qrcode= QRcode_encodeString("sissi",2, QR_ECLEVEL_L, QR_MODE_8,0);

printf("====version=%d========\r\n",qrcode->version);

for(y=0;y<qrcode->width;y++)

{

for(x=0;x<qrcode->width;x++)

{

if(qrcode->data[y*qrcode->width+x]&0x01)

{

printf("#");

// LCM_SetPixel(x,y,1);

}

else

{

printf(" ");

// LCM_SetPixel(x,y,0);

}

}

printf("\r\n");

}

printf("\r\n");

 

//DISPLAY_RENCODE_TO_TFT(0,0,2);

QRcode_free(qrcode);

 

  1. 在startup_stm32f2xx.s中修改堆棧,太小了跑步起來qrcode->version都不對。

    改不了先去掉文件的只讀權(quán)限

     

 

 

  1. 串口打印結(jié)果基本可以基本看到二維碼圖形

  1. QRcode結(jié)構(gòu)體介紹

     

評論 (0 個評論)

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

返回頂部
主站蜘蛛池模板: 亚洲 欧美 日韩 在线 | 亚洲欧美男人天堂 | 国产日韩欧美一区二区 | 成人精品一区二区 | 亚洲国产精品一区在线观看 | 国产精品久久精品 | 精品国产视频 | 最新国产精品 | 欧美国产日韩一区二区三区 | 91玖玖 | 国产高清一区二区 | 操久久| 欧美区在线 | 亚洲综合色丁香婷婷六月图片 | 91精品国产91久久久久久密臀 | 视频在线一区 | 国产精品一区二区视频 | 在线亚州 | 国产一区免费 | 中文一区二区视频 | 欧美一级α片 | 久久久久久久久久久久亚洲 | 国产在线第一页 | 伊人操| 91精品国产92 | 成人影视网 | 欧美一区免费 | 国产中文字幕亚洲 | 一道本在线 | 日韩一区精品 | 成人黄色av | 午夜无码国产理论在线 | 国产一级视频免费播放 | 亚洲视频一区二区三区 | 国产女人第一次做爰毛片 | 亚洲区在线 | 国产情侣在线看 | 国产精品.xx视频.xxtv | 免费视频久久 | 亚洲精彩视频在线观看 | 精品视频一区二区 |