当前位置: 首页 > news >正文

公司网站页面设计软文写作服务

公司网站页面设计,软文写作服务,贸易公司介绍模板,布拖网站建设有IIC接口 和SPI接口 还有8080,6080接口等 arduino SPI接口 直接使用u8g2库实现 //U8G2_SSD1306_128X64_NONAME_F_4W_SW_SPI u8g2(U8G2_R0, /* clock*/ 13, /* data*/ 11, /* cs*/ 10, /* dc*/ 9, /* reset*/ 8); asrpro(SPI接口按下方修改#xff0c;IIC接口官方有驱动… 有IIC接口 和SPI接口 还有8080,6080接口等 arduino SPI接口 直接使用u8g2库实现 //U8G2_SSD1306_128X64_NONAME_F_4W_SW_SPI u8g2(U8G2_R0, /* clock*/ 13, /* data*/ 11, /* cs*/ 10, /* dc*/ 9, /* reset*/ 8); asrpro(SPI接口按下方修改IIC接口官方有驱动 1.下载U8g2库文件 GitHub - olikraus/u8g2: U8glib library for monochrome displays, version 2在D:\天问Block\asrpro\asr_pro_sdk\下新建  U8G2目录  将csrc目录下的所有文件复制到 U8G2目录下 2.将U8G2源文件与头文件添加到 d:\天问Block\asrpro\asr_pro_sdk\projects\offline_asr_sample\project_file\source_file.prj 使用source-file:U8G2/xx.c 添加U8G2下的所有c文件 include-path:U8G2 //添加头文件 3.示例代码 //接线引脚 MOSI PA5 SCK PA6 DC PA3 CS PA2#define CS_PIN 2 #define CS_GPIO_PIN gpio_pin_2 #define DC_PIN 3 #define DC_GPIO_PIN gpio_pin_3 #define RST_PIN 1 #define RST_GPIO_PIN gpio_pin_1 // #define SCK_PIN 5 // #define MOSI_PIN 6 #define SCK_PIN 6 #define MOSI_PIN 5//#define SCK_GPIO_PIN gpio_pin_5 //#define MOSI_GPIO_PIN gpio_pin_6/* 宏定义 --------------------------------------------------------------------*/#define MOSI MOSI_PIN #define SCK SCK_PIN #define DC DC_PIN #define CS CS_PIN#include asr.h extern C{ void * __dso_handle 0 ;} #include setup.h #include myLib/luxiaoban.h #include HardwareSerial.h #include ../U8G2/u8g2.hvoid hardware_init(); void emo_class(); void weather_class();//u8g2_t u8g2;/my initvoid ssd1306_spi_init(){pinMode(CS,output);pinMode(DC,output);//pinMode(RST_PIN,output);pinMode(SCK,output);pinMode(MOSI,output);}uint8_t u8x8_avr_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr){// Re-use library for delaysswitch(msg){//mscase U8X8_MSG_DELAY_MILLI:delay(1);break;//10 uscase U8X8_MSG_DELAY_10MICRO:delay10us();break;//1 nscase U8X8_MSG_DELAY_NANO:delay1us();break;case U8X8_MSG_DELAY_100NANO:delay1us();break;case U8X8_MSG_GPIO_AND_DELAY_INIT: // called once during init phase of u8g2/u8x8ssd1306_spi_init();break; // can be used to setup pinscase U8X8_MSG_GPIO_SPI_CLOCK: // Clock pin: Output level in arg_intif(arg_int)digitalWrite(SCK,1);elsedigitalWrite(SCK,0);break;case U8X8_MSG_GPIO_SPI_DATA: // MOSI pin: Output level in arg_intif(arg_int)digitalWrite(MOSI,1);elsedigitalWrite(MOSI,0);break;case U8X8_MSG_GPIO_CS: // CS (chip select) pin: Output level in arg_intif(arg_int)digitalWrite(CS,1);elsedigitalWrite(CS,0);break;case U8X8_MSG_GPIO_DC: // DC (data/cmd, A0, register select) pin: Output level in arg_intif(arg_int)digitalWrite(DC,1);elsedigitalWrite(DC,0);break;case U8X8_MSG_GPIO_RESET: // Reset pin: Output level in arg_intdefault:break;}return 1; }void u8g2Init(u8g2_t *u8g2) {u8g2_Setup_ssd1306_128x64_noname_f(u8g2, U8G2_R0, u8x8_byte_4wire_sw_spi, u8x8_avr_gpio_and_delay);u8g2_InitDisplay(u8g2);u8g2_SetPowerSave(u8g2, 0);u8g2_ClearBuffer(u8g2); }class u8g2_class {public:u8g2_t u8g2;void u8g2_init(){u8g2_Setup_ssd1306_128x64_noname_f(u8g2, U8G2_R0, u8x8_byte_4wire_sw_spi, u8x8_avr_gpio_and_delay);u8g2_InitDisplay(u8g2);u8g2_SetPowerSave(u8g2, 0);u8g2_ClearBuffer(u8g2);}void sendBuffer(void) { u8g2_SendBuffer(u8g2); }void clearBuffer(void) { u8g2_ClearBuffer(u8g2); } u8g2_uint_t drawGlyph(u8g2_uint_t x, u8g2_uint_t y, uint16_t encoding) { return u8g2_DrawGlyph(u8g2, x, y, encoding); } u8g2_uint_t drawGlyphX2(u8g2_uint_t x, u8g2_uint_t y, uint16_t encoding) { return u8g2_DrawGlyphX2(u8g2, x, y, encoding); } void setColorIndex(uint8_t color_index) { u8g2_SetDrawColor(u8g2, color_index); }void setFont(const uint8_t *font) {u8g2_SetFont(u8g2, font); }void setFontMode(uint8_t is_transparent) {u8g2_SetFontMode(u8g2, is_transparent); }void setBitmapMode(uint8_t is_transparent){ u8g2_SetBitmapMode(u8g2, is_transparent); }void drawBitmap(u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t cnt, u8g2_uint_t h, const uint8_t *bitmap){ u8g2_DrawBitmap(u8g2, x, y, cnt, h, bitmap); }void drawXBM(u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t w, u8g2_uint_t h, const uint8_t *bitmap){ u8g2_DrawXBM(u8g2, x, y, w, h, bitmap); }void drawXBMP(u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t w, u8g2_uint_t h, const uint8_t *bitmap){ u8g2_DrawXBMP(u8g2, x, y, w, h, bitmap); }};stm32arduino stm32f103xx系列 arduino 下直接使用u8g2示列不需设置引脚与时钟 添加U8X8_SSD1306_128X64_NONAME_4W_SW_SPI u8x8(/* clock*/ PA5, /* data*/ PA7, /* cs*/ PA4, /* dc*/ PA6, /* reset*/ PA3); ESP32 未试验应是同的 树莓派 使用luma.oled 库或是adafruit_ssd1306(python) adafruit_circuitpython_ssd1306 u8g2在树莓派中支持并不好不推荐使用暂时无办法 https://github.com/rm-hull/luma.oled oled驱动程序 https://github.com/rm-hull/luma.examples 示列 详细介绍在文件目录下的README.rst中 执行以下命令进行安装 1.$ sudo usermod -a -G i2c,spi,gpio pi  //【好像没什么用】  2.$ sudo apt install python3-dev python3-pip python3-numpy libfreetype6-dev libjpeg-dev build-essential  //【安装依赖包树莓派中好像已经有了】  3.$ sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libportmidi-dev  //【安装依赖包树莓派中好像已经有了】    4.Log out and in again and clone this repository:: //【退出重新进入】    5.$ git clone https://github.com/rm-hull/luma.examples.git  //【在树莓中下载代码包】  6.$ cd luma.examples     7.$ sudo -H pip install -e .  //【上述步骤完成后执行些程序跳过上面步骤直接执行此好像也可以会出现下载错误多次执行注意 -e . 后面的点】 运行方式 进入luma.examples目录下 执行选择下列进行执行 使用SPI接口 python3 animated_gif.py --interface spi 或 -i spi 使用I2C 接口 python3 animated_gif.py --interface i2c 或 -i i2c 使用pygame 在桌面上显示 python3 tv_snow.py -d pygame 示列 python3 3d_box.py -d pygame luckfox 官方有驱动程序使用oled示列修改
http://www.sadfv.cn/news/201336/

相关文章:

  • 成都网站建设 lkcms小红书笔记推广
  • 阜阳做网站的深圳建设网站龙岗网站建设
  • 高端网站建设要网页制作步骤作答题
  • 济南网站中企动力wordpress 获取头像地址
  • 庆阳网站设计wordpress图片浏览插件
  • 单页 网站 模板广州企业做网站
  • 重庆知名网站建设公司免费家装设计效果图
  • 廊坊做网站厂商定制crm客户管理系统设计
  • 是网站建设专业好网站百度指数分析
  • 广东网站建设哪里有网站未备案怎么访问
  • 网站后台修改网站首页怎么做wordpress获取token方法
  • 检察 网站建设常见的erp软件有哪些
  • 宁波搭建网站公司为什么建设厅的网站不好打开
  • 网站空间ftp企业年金个人查询官网
  • 德州公司做网站广州搜发网络科技有限公司
  • 公司网站建设怎么入账企业头像logo设计免费
  • 连云港新站优化装修网站排行榜前十名有哪些
  • 网站建设帖子国内外高校门户网站建设
  • 网站建设工作量评估报价表网站一年费用
  • 做动漫网站要多少钱企业网站建设合作协议范文
  • 自己做众筹网站河南建设工程信息网官网查询
  • 西安做网站哪里便宜wordpress迁移主机后主页不显示
  • 菜鸟必读 网站被入侵后需做的检测 2工程公司简介范文
  • 网站怎么可以做视频播放南昌市住房和城乡建设网站
  • seo短视频网页入口引流网站推荐网站建设做网站
  • 自己接私单网站开发下载网站站开发
  • 宝安营销型网站制作做网站360好还是百度好
  • 苏州企业网站建设做期权注册网站
  • 外贸网站主机选择一二三四视频社区在线
  • 有什么专业做蛋糕的网站吗建设人力资源网站目标