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

企业logo设计多少钱网站自然排名优化

企业logo设计多少钱,网站自然排名优化,常州网站建设公司机构,上海网络科技公司排名水文大师上线。今天一水电子农历牌。 首先讲讲电子配件,一来是电子小屏幕的选择,遇到文字比较多的,尤其是汉字,不要选传统那款128x64 oled,绝对放不下(找到最牛的超小免费字体至少要在8pixel以上才能看清楚)。我选了i…

水文大师上线。今天一水电子农历牌。

首先讲讲电子配件,一来是电子小屏幕的选择,遇到文字比较多的,尤其是汉字,不要选传统那款128x64 oled,绝对放不下(找到最牛的超小免费字体至少要在8pixel以上才能看清楚)。我选了ili9341,觉得趁手。

其次是室温不用api抓的当地天气,而是采用硬件测温,此处上ds18b20,我发现这玩意儿挺高级,管道测温,水下测温包个不锈钢,下去的也是这个模块,可见敏感度还是不错的,常温区间的精确度已经很高了,要注意它的协议是1-wire(即板子上要初始化w1-gpio)。

至于农历的相关信息,是api抓的。接下来发一发代码流水账。

#: cat ds18b20.pyfrom w1thermsensor import W1ThermSensor
sensor = W1ThermSensor()def modify_text(int_temp):with open('/home/nongLi/info_txt/ds18b20.txt', "r+") as f:read_data = f.read()f.seek(0)f.truncate()   #清空文件f.write(int_temp)temperature = str(sensor.get_temperature()) + '\'C'
modify_text(temperature)
#: cat vcgencmd.pyimport osdef temperature_of_raspberry_pi():cpu_temp = os.popen("vcgencmd measure_temp").read().splitlines()return str(cpu_temp[0].replace("temp=", ""))def modify_text(int_temp):with open('/home/nongLi/info_txt/vcgencmd.txt', "r+") as f:read_data = f.read()f.seek(0)f.truncate()   #清空文件f.write(int_temp)modify_text(temperature_of_raspberry_pi())
#: cat api_info.py
#nongLi: https://eolink.o.apispace.com/453456/lives_geo/v001/calendar?days=2
#HK红日:https://data.gov.hk/sc-data/dataset/hk-effo-statistic-cal
#室温:硬件测温-ds18b20
#cpu温度: vcgencmdimport os
import requestsdef modify_text(int_temp):with open('/home/nongLi/info_txt/nongLi.txt', "r+") as f:read_data = f.read()f.seek(0)f.truncate()   #清空文件f.write(int_temp)nongLi_url = "https://eolink.o.apispace.com/453456/lives_geo/v001/calendar"
payload = {"days":"2"}headers = {"X-APISpace-Token": "buy it","Authorization-Type":"apikey"
}response=requests.request("GET", nongLi_url, params=payload, headers=headers)#print(response.text)modify_text(response.text)
#: cat txt_integration.py
import os
import json
from datetime import datetime##农历文本整理
with open('info_txt/nongLi.txt','r') as load_f:load_dict = json.load(load_f)
target_dict = load_dict['result'][1]
target_date = datetime.strptime(str(target_dict['date']),'%Y-%m-%d')
txt1 = str(target_dict['date']) + "; " + str(target_dict["moreDetail"]["constellation"]) + "; " + str(target_dict['lunar']) + ' ' + str(target_dict["festival"]) + ' '
txt2 = str(target_dict['ganzhiYear']) + ' ' + str(target_dict['ganzhiMonth']) + ' ' + str(target_dict['ganzhiDay']) + ' '
txt3 = '纳音: ' + str(target_dict["moreDetail"]["elementYear"]) + " " + str(target_dict["moreDetail"]["elementMonth"]) + " " + str(target_dict["moreDetail"]["elementDay"]) + '\n'
txt4 = '彭祖百忌: ' + str(target_dict['moreDetail']['pzTaboo']) + '\n'
txt5 = '宜: ' + str(target_dict['fitting']) + '\n'
txt6 = '忌: ' + str(target_dict['taboo']) + '\n'
txt7 = '冲: ' + str(target_dict["moreDetail"]["chong"]) + '; ' + '煞: ' + str(target_dict["moreDetail"]["sha"]) + '\n'
txt8 = str(target_dict["solarTerm"]) + str(target_dict["stDays"]) + '天,' + str(target_dict["nextSt"]) + str(target_dict["nextstDays"]) + "天后。" + '\n'##cpu温度整理
with open('/home/nongLi/info_txt/vcgencmd.txt','r') as temp_f:rpi_temp = temp_f.read()##室温整理
with open('/home/nongLi/info_txt/ds18b20.txt','r') as f_temp:current_temp = f_temp.read()
txt1 = txt1 + current_temp + '\n'
txt2 = txt2 + rpi_temp + '\n'
txt9 = txt1 + txt2 + txt3 + txt4 + txt5 + txt6 + txt7 + txt8##香港红日整理
def yyyymmdd_convertor(str_date):return datetime.strptime(str_date,'%Y%m%d')with open("/home/nongLi/info_txt/hk_holidays.json",'r', encoding='utf-8-sig') as decode_f:holidays_dict = json.load(decode_f)
hk_list = holidays_dict['vcalendar'][0]['vevent']
hk_summary = ""
hk_flag = 0
for i in hk_list:first_date = yyyymmdd_convertor(i['dtstart'][0])last_date = yyyymmdd_convertor(i['dtend'][0])if target_date == first_date or target_date == last_date:#summary = i["summary"]hk_flag = 1breakif target_date > first_date and target_date < last_date:#summary = i["summary"]hk_flag = 1breakif hk_flag == 1:final_text = txt9 + "港假"
elif hk_flag == 0:final_text = txt9
else:final_text = "Error Error Error!"def modify_text(int_temp):with open('info_txt/display.txt', "r+") as f:read_data = f.read()f.seek(0)f.truncate()   #清空文件f.write(int_temp)modify_text(final_text)
#: cat display_ili9341.py
import time
import busio
import digitalio
from board import SCK, MOSI, MISO, CE0, D24, D23from adafruit_rgb_display import color565
import adafruit_rgb_display.ili9341 as ili9341
from PIL import Image,ImageDraw,ImageFont# Configuration for CS and DC pins:
CS_PIN = CE0
DC_PIN = D24
RESET_PIN = D23# Setup SPI bus using hardware SPI:
spi = busio.SPI(clock=SCK, MOSI=MOSI)# Create the ILI9341 display:
disp = ili9341.ILI9341(spi,rotation=270,cs=digitalio.DigitalInOut(CS_PIN),dc=digitalio.DigitalInOut(DC_PIN),rst=digitalio.DigitalInOut(RESET_PIN))disp.fill(0)width=disp.width
height=disp.height# 文字显示
with open('/home/nongLi/info_txt/display.txt','r') as f:buffer_txt = f.read()
image1=Image.new('RGB',(height,width))
draw1=ImageDraw.Draw(image1)
font1=ImageFont.truetype('/home/nongLi/fonts/SimSun-special.ttf',12) #SimSun-Special save my day!
draw1.text((0,0),buffer_txt,font=font1,fill=color565(234,255,0))try:disp.image(image1)
except Exception as e:print(e)disp.fill(0)
#: sudo crontab -e0 1 * * * /usr/bin/python /home/nongLi/api_info.py  #凌晨1点取一次。
*/10 * * * * /usr/bin/python /home/nongLi/ds18b20_temp.py #每十分钟
*/10 * * * * /usr/bin/python /home/nongLi/vcgencmd.py
*/11 * * * * /usr/bin/python /home/nontLi/txt_integration.py
*/12 * * * * /usr/bin/python /home/nongLi/display_ili9341.py

大概得布局图如下,主要别忘了那个上拉电阻加到ds18b20的正极和数据线两端。

http://www.ysxn.cn/news/1099.html

相关文章:

  • 桂林有名网站制作公司关键词网络推广企业
  • 广东省医院建设协会网站首页个人网站的制作模板
  • 云南省住房和城乡建设厅网站网站搜索引擎优化的步骤
  • 网站域名在哪买市场推广计划书
  • 黑龙江疫情最新郑州百度seo关键词
  • 网站做cdn怎么弄重庆seo推广
  • 做响应式网站制作杭州网站关键词排名优化
  • 北京网站设计建设公司长沙营销网站建设
  • seo是什么意思啊电商企业网站优化公司
  • 腾讯nba新闻重庆seo教程
  • js网站模板免费下载如何线上推广引流
  • 购物网站哪个质量好百度商城官网首页
  • 佛山市研发网站建设哪家好百度2023免费
  • 网站怎么做站群seo是对网站进行什么优化
  • 全运会网站的建设品牌网络营销策划书
  • 济南网站开发xywlcngoogleseo优化
  • 做网站推广员工今日全国最新疫情通报
  • 网站开发分为哪几种类型seo研究中心
  • 中山网站建设价格百度在线扫一扫
  • 黄冈网站建设 网络推广网络营销顾问招聘
  • 服务佳的小企业网站建设seo1短视频网页入口营销
  • 福建龙岩天宫山风景区常州seo建站
  • 室内设计效果图360全景图青岛百度整站优化服务
  • h5建站模板最新的疫情最新消息
  • 怎么做网站后台 更新日志什么叫软文
  • 网站群建设的优点电商平台营销策划方案
  • 昆明seo网站建设厦门人才网个人会员
  • 网站后台不更新网络广告推广平台
  • 网站所有者查询乔拓云智能建站平台
  • 上海建设网站的公司百度官方电话