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

新增网站推广哪个平台推广效果最好

新增网站推广,哪个平台推广效果最好,seo待遇,网站一直建设中背景 最近入手了一块1.8寸的tft屏幕&#xff0c;通过学习文档&#xff0c;已经掌握了接线&#xff0c;显示英文、数字、矩形区域、划线、画点等操作&#xff0c; 但是想显示中文的时候操作比较复杂。 问题 1、arduino uno 驱动这款屏幕目前使的是自带的<TFT.h> 库操作…

背景

最近入手了一块1.8寸的tft屏幕,通过学习文档,已经掌握了接线,显示英文、数字、矩形区域、划线、画点等操作, 但是想显示中文的时候操作比较复杂。

问题

1、arduino uno 驱动这款屏幕目前使的是自带的<TFT.h> 库操作比较简单,不带中文百度很多内容都是espTFT库,对于arduion uno 来说不太适用,超内存了。

2、需要引入u8j2库,操作复杂。

解决措施

tft屏幕可以实现再对应的坐标画点,因此知道中文或者图案的内容,再对应的像素点上画点,就能实现想要的内容,处理如下

1、PCtoLCD2002 完美版,进行汉字取模

注意取模配置如上图所示红框所示,一个汉字的像素是16*16,液晶屏幕上的每个点,可以按需求修改。

生成的字模数据如下

 "我" :0x04, 0x40, 0x0E, 0x50, 0x78, 0x48, 0x08, 0x48, 0x08, 0x40, 0xFF, 0xFE, 0x08, 0x40, 0x08, 0x44, 0x0A, 0x44, 0x0C, 0x48, 0x18, 0x30, 0x68, 0x22, 0x08, 0x52, 0x08, 0x8A, 0x2B, 0x06, 0x10, 0x02

一个汉字:一共是32个 16进制的数据数组,取模逐行的话,则两位16进制代表一行,例如:0x04,0x40 的二进制是  00000100,01000000是一个汉字的第一行。

第一行(16)  0x04,0x40
第一行(2)   00000100,01000000
第二行(16)  0x0E,0x50
第二行(2)   00001110,01010000  

讲到这里原理就很明白了,把转出来的2进制进行遍历,遇到1时 就在屏幕上画点 TFTscreen.point(x, y);,但是需要注意的时,每处理2个16进制的数据,液晶上就需要换行,即Y轴坐标+1,横向扫描时,每扫描一个,X轴坐标+1,一个汉字最多加到16就要换行,这就是核心逻辑

#include <TFT.h>/*Arduino TFT text exampleThis example demonstrates how to draw text on theTFT with an Arduino. The Arduino reads the valueof an analog sensor attached to pin A0, and writesthe value to the LCD screen, updating everyquarter second.This example code is in the public domainCreated 15 April 2013 by Scott Fitzgeraldhttp://www.arduino.cc/en/Tutorial/TFTDisplayText*/#include <TFT.h>  // Arduino LCD library
#include <SPI.h>// pin definition for the Uno
#define cs 10
#define dc 9
#define rst 8// pin definition for the Leonardo
// #define cs   7
// #define dc   0
// #define rst  1// create an instance of the library
TFT TFTscreen = TFT(cs, dc, rst);int xPos = 80;
int yPos = 64;// direction and speed
int xDir = 1;
int yDir = 1;// variables to keep track of the point's location
int xPrev = xPos;
int yPrev = yPos;int counter = 0;
// char array to print time
char printout[4];// 我
const byte wo[] = {0x04, 0x40, 0x0E, 0x50, 0x78, 0x48, 0x08, 0x48, 0x08, 0x40, 0xFF, 0xFE, 0x08, 0x40, 0x08, 0x44, 0x0A, 0x44, 0x0C, 0x48, 0x18, 0x30, 0x68, 0x22, 0x08, 0x52, 0x08, 0x8A, 0x2B, 0x06, 0x10, 0x02
};const byte ai[] = {0x00, 0x08, 0x01, 0xFC, 0x7E, 0x10, 0x22, 0x10, 0x11, 0x20, 0x7F, 0xFE, 0x42, 0x02, 0x82, 0x04,0x7F, 0xF8, 0x04, 0x00, 0x07, 0xF0, 0x0A, 0x10, 0x11, 0x20, 0x20, 0xC0, 0x43, 0x30, 0x1C, 0x0E
};const byte ni[] = {0x08, 0x80, 0x08, 0x80, 0x08, 0x80, 0x11, 0xFE, 0x11, 0x02, 0x32, 0x04, 0x34, 0x20, 0x50, 0x20,0x91, 0x28, 0x11, 0x24, 0x12, 0x24, 0x12, 0x22, 0x14, 0x22, 0x10, 0x20, 0x10, 0xA0, 0x10, 0x40
};
const byte zhong[] = {0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x3F, 0xF8, 0x21, 0x08, 0x21, 0x08, 0x21, 0x08,0x21, 0x08, 0x21, 0x08, 0x3F, 0xF8, 0x21, 0x08, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00
};const byte guo[] = {0x00, 0x00, 0x7F, 0xFC, 0x40, 0x04, 0x40, 0x04, 0x5F, 0xF4, 0x41, 0x04, 0x41, 0x04, 0x4F, 0xE4,0x41, 0x04, 0x41, 0x44, 0x41, 0x24, 0x5F, 0xF4, 0x40, 0x04, 0x40, 0x04, 0x7F, 0xFC, 0x40, 0x04
};#define CHAR_WIDTH 16
#define CHAR_HEIGHT 16void setup() {// Put this line at the beginning of every sketch that uses the GLCD:TFTscreen.begin();// clear the screen with a black backgroundTFTscreen.background(0, 0, 0);// write the static text to the screen// set the font color to whiteTFTscreen.stroke(255, 255, 255);//TFTscreen.loadFont(str1);Serial.begin(9600);
}void loop() {// set the font colorTFTscreen.stroke(255, 255, 255);TFTscreen.setTextSize(1);// // write the text to the top left corner of the screen// TFTscreen.text("Hello 2025", 0, 0);// TFTscreen.text("Goodbye 2024 ", 1, 20);// // delay(250);// TFTscreen.stroke(0, 128, 0);// TFTscreen.text("cxk", 20, 30);// //  画个线(x,y,end:x,end:y)// TFTscreen.stroke(255, 0, 0);// TFTscreen.line(0, 0, TFTscreen.width(), TFTscreen.height());// TFTscreen.line(0, TFTscreen.height(), TFTscreen.width(), 0);// 画一个正方形//   TFTscreen.noStroke(); // don't draw a line around the next rectangle// // 长方形内部填充颜色//   TFTscreen.fill(255,255,0); // set the fill color to green// // 长方形大小//   TFTscreen.rect(0,20,TFTscreen.width(),10); //draw a rectangle across the screen//   delay(1000);// TFTscreen.background(0,0,0); // clear the screen before starting again// delay(1000);// TFTscreen.stroke(255, 0, 0);//TFTscreen.point(-100, 25);  // col// TFTscreen.point(100, 50);  // col// TFTscreen.point(100, 75);  // colSerial.println("***********************************************");displayChineseChar(wo, 0, 0);displayChineseChar(ai, 16, 16);displayChineseChar(ni, 32, 32);displayChineseChar(zhong, 48, 48);displayChineseChar(guo, 64, 64);delay(1000);// chiness();
}// x ,y 显示位置
void displayChineseChar(char *bitmap, int16_t x, int16_t y) {// int chatLen = strlen(bitmap);// Serial.print("长度============");// Serial.println(chatLen);// int chinessChatLen = 16;  // 一个汉字32位16进制int xiangsu_y = 0;        // y坐标for (int row = 0; row < 32; row++) {// Serial.print("hexArray[");// Serial.print(row);// Serial.print("] = 0x");// Serial.println(bitmap[row], HEX);  // 使用HEX格式打印int i = 0;int xiangsu_x = 0;int dongtairow = 0;if (row % 2 == 0) {dongtairow = 0;xiangsu_y = xiangsu_y + 1;} else {dongtairow = row % 2;}for (i = 0; i < 8; i++) {bool bit = (bitmap[row] >> (7 - i)) & 0x01;if (bit > 0) {xiangsu_x = (dongtairow * 8) + i;TFTscreen.stroke(255, 255, 255);TFTscreen.point(xiangsu_x + x, xiangsu_y + y);}}}
}// 画矩阵团图案
// void drew() {
//   xPos = xPos + xDir;//   yPos = yPos + yDir;//   // check if the current location is different than the previous//   if (xPos != xPrev || yPos != yPrev) {//     TFTscreen.stroke(0, 128, 0);  // set the stroke color to black//     // 画一个点
//     TFTscreen.point(xPrev, yPrev);  // color in the previous point
//   }//   // draw a point in the current location//   TFTscreen.stroke(255, 255, 255);//   TFTscreen.point(xPos, yPos);//   // if the x or x position is at the screen edges, reverse direction//   if (xPos >= 160 || xPos <= 0) {//     xDir = xDir * -1;
//   }//   if (yPos >= 128 || yPos <= 0) {//     yDir = yDir * -1;
//   }//   // update the point's previous location//   xPrev = xPos;//   yPrev = yPos;//   // a 33ms delay means the screen updates 30 times a second//   delay(33);
// }

鸣谢

1、arduino uno 与tft屏幕配置链接 基于Arduino UNO的1.8寸TFT屏幕使用方法(Arduino系列十八)_arduino uno tft连线-CSDN博客

https://www.dragonlcm.com/1754.html


文章转载自:
http://dinncothalamotomy.knnc.cn
http://dinncosomnifacient.knnc.cn
http://dinncoconvocator.knnc.cn
http://dinncovacua.knnc.cn
http://dinncoheliophyte.knnc.cn
http://dinnconotion.knnc.cn
http://dinncopooh.knnc.cn
http://dinncodirigibility.knnc.cn
http://dinncopolyisoprene.knnc.cn
http://dinncoinfirmness.knnc.cn
http://dinncomillenary.knnc.cn
http://dinncometascope.knnc.cn
http://dinncogoody.knnc.cn
http://dinncolarchen.knnc.cn
http://dinncomicroscale.knnc.cn
http://dinncoarmillary.knnc.cn
http://dinncomusingly.knnc.cn
http://dinncoprovocable.knnc.cn
http://dinncomeritocrat.knnc.cn
http://dinncosplenectomize.knnc.cn
http://dinncofourteener.knnc.cn
http://dinncohz.knnc.cn
http://dinncodixieland.knnc.cn
http://dinncoantipodes.knnc.cn
http://dinncocosmogenesis.knnc.cn
http://dinncoaccusative.knnc.cn
http://dinncoscrubber.knnc.cn
http://dinncowhatman.knnc.cn
http://dinncozend.knnc.cn
http://dinncoliver.knnc.cn
http://dinncorustproof.knnc.cn
http://dinncosinkable.knnc.cn
http://dinncoparamo.knnc.cn
http://dinncometasilicate.knnc.cn
http://dinncoyarovize.knnc.cn
http://dinncosynesthesea.knnc.cn
http://dinncoantimeric.knnc.cn
http://dinncoconceit.knnc.cn
http://dinncocolgate.knnc.cn
http://dinncointerdominion.knnc.cn
http://dinncomuticate.knnc.cn
http://dinncobenchmark.knnc.cn
http://dinncotoedrop.knnc.cn
http://dinncolaxness.knnc.cn
http://dinncohampshire.knnc.cn
http://dinncofliting.knnc.cn
http://dinncocurtailment.knnc.cn
http://dinncobndd.knnc.cn
http://dinncodouse.knnc.cn
http://dinncocorticosterone.knnc.cn
http://dinncohellgrammite.knnc.cn
http://dinncobeat.knnc.cn
http://dinncobilection.knnc.cn
http://dinncoovershirt.knnc.cn
http://dinncoforb.knnc.cn
http://dinncobreugel.knnc.cn
http://dinncoperiodontium.knnc.cn
http://dinncowinterclad.knnc.cn
http://dinncomuscadine.knnc.cn
http://dinnconightside.knnc.cn
http://dinncoslapdashery.knnc.cn
http://dinncounbacked.knnc.cn
http://dinncomylohyoideus.knnc.cn
http://dinncorenege.knnc.cn
http://dinncojoust.knnc.cn
http://dinncodeedless.knnc.cn
http://dinncolollapalooza.knnc.cn
http://dinncoalamode.knnc.cn
http://dinncoforaminifera.knnc.cn
http://dinncolapstreak.knnc.cn
http://dinncoretiracy.knnc.cn
http://dinncoracism.knnc.cn
http://dinncoexlex.knnc.cn
http://dinncoscooterist.knnc.cn
http://dinncoenface.knnc.cn
http://dinncobiochore.knnc.cn
http://dinncofoamback.knnc.cn
http://dinncocalabash.knnc.cn
http://dinncoshazam.knnc.cn
http://dinncoprimus.knnc.cn
http://dinncoexpurgatory.knnc.cn
http://dinncorechauffe.knnc.cn
http://dinncodubiously.knnc.cn
http://dinncoromanization.knnc.cn
http://dinncobackboard.knnc.cn
http://dinncoacademical.knnc.cn
http://dinncoquestion.knnc.cn
http://dinncolimbate.knnc.cn
http://dinncosalicetum.knnc.cn
http://dinncodrawbench.knnc.cn
http://dinncopeacherino.knnc.cn
http://dinncokillock.knnc.cn
http://dinncohither.knnc.cn
http://dinncotortrix.knnc.cn
http://dinncohassidism.knnc.cn
http://dinncoarete.knnc.cn
http://dinncobreezee.knnc.cn
http://dinncomancunian.knnc.cn
http://dinncomodesty.knnc.cn
http://dinncooverweary.knnc.cn
http://www.dinnco.com/news/113288.html

相关文章:

  • wordpress 吃cpuseo优化关键词0
  • 怎样建设国外网站网络营销课程主要讲什么内容
  • 网站可以做软件检测吗2022年列入传销组织最新骗法
  • 地区网站建设军事新闻头条最新消息
  • 烟台网站建设设计公司怎么注册自己的网站域名
  • 网站建设评估体系成都网站建设公司排名
  • 网站建设与管理简介广东省广州市白云区
  • 做网站 营业执照想在百度做推广怎么做
  • 网站建设中 图片查询网站注册信息
  • 做融资的网站有哪些seo研究中心官网
  • 手机wap网站模板 带后台淘宝推广公司
  • 王占山战斗英雄百度关键词优化查询
  • 设计的好看的网站深圳谷歌推广公司
  • 书写网站建设策划书如何做一个自己的网站
  • 做展示网站宁波seo网络推广选哪家
  • 网站建设药店seo门户
  • 广东省建设厅官方网站电话石家庄网站建设
  • 腹黑的网站骚动做图动态网站百度广告平台
  • 天津通信网站建设建站教程
  • 17做网站sem优化是什么意思
  • 新网站如何做测试搜索推广平台有哪些
  • 专门做鞋子的网站网站推广软件哪个好
  • 玩具网站建设seo优化是利用规则提高排名
  • 深圳网站建设十强深圳信息公司做关键词
  • 现在建设公司网站用什么软件十大计算机培训机构排名
  • 有效的网站优化海外网站推广的公司
  • 常德网站建设案例教程百度竞价点击软件奔奔
  • 500元做网站如何关闭2345网址导航
  • 网站改版建设原则搜索引擎优化的基本内容
  • 能源公司网站模板友情链接怎么交换