2017年11月17日

SPI编程

摘要: #include <stdio.h>#include <wiringPi.h>#include <wiringPiSPI.h> int main(void){ unsigned char date[2],rec[2]; int spiChannel = 0; int clock = 1000000; 阅读全文

posted @ 2017-11-17 09:20 玲珑子 阅读(801) 评论(0) 推荐(0) 编辑

2017年11月13日

树莓派配置(一):打开SPI

摘要: 1.树莓派默认SPI关闭,在进行编程前需要打开SPI cd /boot/ sudo vi config.txt 将#dtparam=spi=off 改成:dtparam=spi=on 重启 sudo reboot 之后会在/dev/目录下看到 spidev0.0 和 spidev0.1两个驱动设备 阅读全文

posted @ 2017-11-13 16:40 玲珑子 阅读(7678) 评论(0) 推荐(0) 编辑

2017年11月1日

C++: I/O流详解(三)——串流

摘要: 一、串流 串流类是 ios 中的派生类 C++的串流对象可以连接string对象或字符串 串流提取数据时对字符串按变量类型解释;插入数据时把类型 数据转换成字符串 串流I/O具有格式化功能 例: 阅读全文

posted @ 2017-11-01 22:07 玲珑子 阅读(1425) 评论(0) 推荐(0) 编辑

C++: I/O流详解(二)——输入输出格式控制

摘要: 一、格式控制 ios提供直接设置标志字的控制格式函数 iostream和iomanip库还提供了一批控制符简化I/O格式化操作 设置标识字: 例1: 输出: 例二:不同基数形式的输入输出 输出: 例三:格式化输出浮点数 二、格式控制符 控制符是istream和ostream类定义了一批函数,作为重载 阅读全文

posted @ 2017-11-01 21:44 玲珑子 阅读(2641) 评论(0) 推荐(0) 编辑

C++: I/O流详解

摘要: 一、输入流操作 1.read 无格式输入指定字节数 istream& read ( char* pch, int nCount ); istream& read ( unsigned char* puch, int nCount ); istream& read ( signed char* psc 阅读全文

posted @ 2017-11-01 21:12 玲珑子 阅读(1819) 评论(0) 推荐(1) 编辑

2017年10月30日

Ubuntu 与 Windows 共享文件夹

摘要: 1. Ubuntu关机后 编辑虚拟机设置->option->共享文件夹->添加->确定 完成! 2.共享文件夹后在/mnt/hgfs/文件夹下无法看到共享的文件夹: 解决方法: 打开终端 cd /media/VMware Tools/ 里面有个VMwareTools-xxx-xxx.tar.gz , 阅读全文

posted @ 2017-10-30 09:50 玲珑子 阅读(182) 评论(0) 推荐(0) 编辑

2017年10月22日

C++: C++函数声明的时候后面加const

摘要: 转自:http://blog.csdn.net/zhangss415/article/details/7998123 非静态成员函数后面加const(加到非成员函数或静态成员后面会产生编译错误),表示成员函数隐含传入的this指针为const指针,决定了在该成员函数中,任意修改它所在的类的成员的操作 阅读全文

posted @ 2017-10-22 14:01 玲珑子 阅读(28036) 评论(0) 推荐(3) 编辑

2017年9月14日

LeetCode: 171 Excel Sheet Column Number(easy)

摘要: 题目: Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example 阅读全文

posted @ 2017-09-14 21:14 玲珑子 阅读(155) 评论(0) 推荐(0) 编辑

LeetCode: 453 Minimum Moves to Equal Array Elements(easy)

摘要: 题目: Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementin 阅读全文

posted @ 2017-09-14 21:12 玲珑子 阅读(85) 评论(0) 推荐(0) 编辑

2017年9月11日

LeetCode: 455 Assign Cookies(easy)

摘要: 题目: Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has 阅读全文

posted @ 2017-09-11 21:57 玲珑子 阅读(128) 评论(0) 推荐(0) 编辑

导航