pic

How to make Timer1 more accurate as a real time clock?

不想你离开。 提交于 2020-01-24 19:03:27
问题 I have PIC18F87J11 with 8 MHz oscillator and I am using timer1 as real time clock. At this moment I have it toggle an LED every 1 minute. I noticed it does work perfect fine the first few times but slowly it starts toggling the LED every 59 seconds. Then every few minutes it keeps going down to 58, 57, etc. I don't know if its impossible to get an accurate clock using internal oscillator or if I need external oscillator. My settings look right for timer1, I just hope I can resolve this issue

Python全栈——文件上传下载

余生颓废 提交于 2020-01-24 17:58:48
server.py import socket import pickle # 不传参数,默认使用基于网络类型的套接字,协议:TCP server = socket . socket ( ) # 告诉别人server的地址和端口 # 端口的范围是0-65535,但是0-1023这些是默认端口不能使用 server . bind ( ( '192.168.1.107' , 18080 ) ) # 能同时接受的连接 server . listen ( ) # 接受客户端的连接,阻塞等待 conn , addr = server . accept ( ) pic_dic = conn . recv ( 1024 ) dic = pickle . loads ( pic_dic ) if dic [ 'opt' ] == 'upload' : # 上传功能 filename = '1' + dic [ 'filename' ] with open ( filename , 'w' , encoding = 'utf-8' ) as f : f . write ( dic [ 'content' ] ) elif dic [ 'opt' ] == 'download' : # 下载功能 filename = dic [ 'filename' ] with open ( filename ,

快速生成 Mac App icns 图标

混江龙づ霸主 提交于 2020-01-23 00:22:07
1 准备一个 1024 * 1024 的png图片,假设名字为 pic.png 2 先进入图片所在的目录,然后执行命令行 $ mkdir tmp.iconset ,创建一个临时目录存放不同大小的图片 3 把原图片转为不同大小的图片,并放入上面的临时目录 #全部拷贝到命令行回车执行,执行结束之后去tmp.iconset查看十张图片是否生成好 sips - z 16 16 pic . png - - out tmp . iconset / icon_16x16 . png sips - z 32 32 pic . png - - out tmp . iconset / icon_16x16@2x . png sips - z 32 32 pic . png - - out tmp . iconset / icon_32x32 . png sips - z 64 64 pic . png - - out tmp . iconset / icon_32x32@2x . png sips - z 128 128 pic . png - - out tmp . iconset / icon_128x128 . png sips - z 256 256 pic . png - - out tmp . iconset / icon_128x128@2x . png sips - z 256 256

Python 打造专属照片墙

廉价感情. 提交于 2020-01-21 01:56:22
1、 先直接上代码 import random from PIL import Image import os # 照片墙 背景 照片素材 图形 #定义图形 fingure = [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1,

原生js实现无缝轮播

五迷三道 提交于 2020-01-19 05:40:45
原生js实现无缝轮播   因为要做到无缝,所以就要把第一张图片和最后一张连接起来,在此处采用js克隆了第一张图片的节点,添加到最后,显示图片序号的小圆按钮也是使用js动态添加的。 html部分 <div class="banner" id="banner"> <ul class="pic" id="pic"> <li><a href="javascript:void(0)"><img src="images/1.jpg"></a></li> <li><a href="javascript:void(0)"><img src="images/2.png"></a></li> <li><a href="javascript:void(0)"><img src="images/3.png"></a></li> <li><a href="javascript:void(0)"><img src="images/4.png"></a></li> <li><a href="javascript:void(0)"><img src="images/5.jpg"></a></li> <li><a href="javascript:void(0)"><img src="images/6.png"></a></li> <li><a href="javascript:void(0)"><img src=

原生js实现动画过渡效果

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-16 00:54:48
原生JS实现动画过渡效果原理 一般情况实现动画效果可以采用CSS3里的 transition 属性实现动画过渡。但如果有需求只能采用原生JS的情况下可以采用JS里的 定时器 功能。当然还有很多可以实现动画效果的方法。因为本人初步接触前端,实力不足这里只讲一下 定时器 的使用。 以固定的时间(极短)每次将CSS样式修改一点,达到视觉上的动画效果,使运动看起来不是特别生硬。 定时器使用 var timer = null ; timer = setInterval ( function ( ) { pic . style . width = pic . offsetWidth + speed + "px" ; } } , time ) 这里的 pic 可以是任意元素, speed 则是单位时间 pic 宽度的变换量(速度), time 是执行一次的时间。当 time 足够小时 pic 就会使宽度的变化以动画形式展现。 但是这种情况下 pic 的宽度会一直以 speed 的速度执行下去。我们需要加一个条件,当满足此条件时结束 定时器 。 var timer = null ; clearInterval ( timer ) ; timer = setInterval ( function ( ) { if ( pic . style . width >= 150 + "px" ) {

JAVA课程笔记系列: 基于SpringBoot的Data Solr搜索引擎开发

佐手、 提交于 2020-01-14 12:22:21
基于SpringBoot的Data Solr搜索引擎开发 关于Apache Solr的简介 Solr它是一种开放源码的、基于 Lucene Java 的搜索服务器,易于加入到 Web 应用程序中。Solr 提供了层面搜索(就是统计)、命中醒目显示并且支持多种输出格式(包括XML/XSLT 和JSON等格式)。它易于安装和配置,而且附带了一个基于HTTP 的管理界面。可以使用 Solr 的表现优异的基本搜索功能,也可以对它进行扩展从而满足企业的需要。Solr的特性包括: 高级的全文搜索功能 专为高通量的网络流量进行的优化 基于开放接口(XML和HTTP)的标准 综合的HTML管理界面 可伸缩性-能够有效地复制到另外一个Solr搜索服务器 使用XML配置达到灵活性和适配性 可扩展的插件体系 支持像英语,德语,中国,日本,法国和许多主要语言 Apache Solr和Lucene的关系 Solr 与Lucene 并不是竞争对立关系,恰恰相反Solr 依存于Lucene ,因为Solr 底层的核心技术是使用Apache Lucene 来实现的,简单的说Solr 是Lucene 的服务器化。需要注意的是Solr 并不是简单的对Lucene 进行封装,它所提供的大部分功能都区别于Lucene。 Apache Solr 相关目录说明 Solr程序包的结构说明 bin :solr相关运行脚本

x86 PIC, is it correct for QEMU to raise interrupts on all CPUs?

不想你离开。 提交于 2020-01-14 09:51:51
问题 I recently had to work around a proprietary OS issue with the x86 PIC where the OS expected timer interrupts ONLY on CPU0. I enabled the IO-APIC to get around this and did CPU steering so the interrupts went only to CPU0. Problem solved. I was told that our hardware is broken to do such a thing. i.e. raise timer interrupts on all CPUs when only a PIC is in use. The 'hardware' in question is QEMU/KVM. Is QEMU/KVM at fault here ? Is the OS making an invalid assumption ? My suspicion is that

好看的html 动画特效

元气小坏坏 提交于 2020-01-14 09:39:48
好看的html 动画特效 <div class="wrap"> <!--部署内外层图片--> <div class="cube"> <!--前面图片 --> <div class="out_front"> <img src="https://www.cnblogs.com/images/cnblogs_com/php-linux/674292/o_1.jpg" class="pic"> </div> <!--后面图片 --> <div class="out_back"> <img src="https://www.cnblogs.com/images/cnblogs_com/php-linux/674292/o_2.jpg" class="pic"> </div> <!--左面图片 --> <div class="out_left"> <img src="https://www.cnblogs.com/images/cnblogs_com/php-linux/674292/o_3.jpg" class="pic"> </div> <!--右面图片 --> <div class="out_right"> <img src="https://www.cnblogs.com/images/cnblogs_com/php-linux/674292/o_4.jpg" class="pic">

Get substring from data received UART and put to LCD

杀马特。学长 韩版系。学妹 提交于 2020-01-13 19:57:53
问题 Posted as a new quesion based on this one (OP originally made a massive change to the question that was rolled back), as user stated they could not ask the question themselves. About PIC 16F877A : I receive from a UART (a COM port) and show to an LCD 16x4. My data received is formed: Line1#Line2#Line3#Line4 I want to put the data received to LCD as below: /*LCD16x4 :~~~~~~~~~~~~~~~~: : Line1 : : Line2 : : Line3 : : Line4 : :________________: */ I put the char array to row x , col y (begin at