Acadia Lab 228 + Lab 222
又是一对串烧实验,布好线后非常方便就可以一起完成。
连线方案一模一样:


Lab 228 数码管骰子
核心代码如下:
def loop() :
global cnt
global btn_read,sec,on gpio.digital_write(channel[8],LOW)
gpio.digital_write(channel[9],LOW)
gpio.digital_write(channel[10],LOW)
gpio.digital_write(channel[11],HIGH)
display_digit(digit1)
delay(5)
cnt=cnt+5 btn_read=gpio.digital_read('gpio1')
if btn_read==1:
delay(20)
btn_read=gpio.digital_read('gpio1')
if btn_read ==1:
if on==1:
print("warning: stop here!")
on=0
else :
print("game begins!")
on=1 if cnt>=100 and on==1 :
cnt=0
get_digit()
视频地址如下:
http://v.youku.com/v_show/id_XMTI2MzM4NDk4MA==.html
Lab 222 秒表
核心代码如下:
gpio.digital_write(channel[8],HIGH)
gpio.digital_write(channel[9],LOW)
gpio.digital_write(channel[10],LOW)
gpio.digital_write(channel[11],LOW)
display_digit(digit4)
delay(5)
cnt = cnt + 5 gpio.digital_write(channel[8],LOW)
gpio.digital_write(channel[9],HIGH)
gpio.digital_write(channel[10],LOW)
gpio.digital_write(channel[11],LOW)
display_digit(digit3)
delay(5)
cnt=cnt+5 gpio.digital_write(channel[8],LOW)
gpio.digital_write(channel[9],LOW)
gpio.digital_write(channel[10],HIGH)
gpio.digital_write(channel[11],LOW)
display_digit(digit2)
gpio.digital_write(channel[2],LOW)
delay(5)
cnt=cnt+5 gpio.digital_write(channel[8],LOW)
gpio.digital_write(channel[9],LOW)
gpio.digital_write(channel[10],LOW)
gpio.digital_write(channel[11],HIGH)
display_digit(digit1)
delay(5)
cnt=cnt+5
视频地址如下:
http://v.youku.com/v_show/id_XMTI2MTE4MzAwNA==.html?f=25838393
唯一能说一说的经验就是:一般显示错误都是连线没连好(大雾)
我特么就是某个横杠一直显示不对,改了半天代码,最后换了根线就好了,(╯‵□′)╯︵┴─┴
Acadia Lab 228 + Lab 222的更多相关文章
- Innovus Lab和Lab Guide下载地址 | Innovus教程 - Flow系列 - 数据准备
本文转自:自己的微信公众号<集成电路设计及EDA教程> <Innovus Lab和Lab Guide下载地址 | Innovus教程 - Flow系列 - 数据准备> ...
- Acadia Lab 203 + Lab 231
在做完 Lab 6 之后,惊觉选做实验缺口很大,于是遍历了一遍夏任务,找到了一条最省力的路线. 做完 Lab 6 的连线不用拆,可以接下来做以下两个实验: Lab 203 网络时钟 核心代码如下: v ...
- 6.824 Lab 5: Caching Extents
Introduction In this lab you will modify YFS to cache extents, reducing the load on the extent serve ...
- 常用增强学习实验环境 I (MuJoCo, OpenAI Gym, rllab, DeepMind Lab, TORCS, PySC2) (转载)
原文地址:http://blog.csdn.net/jinzhuojun/article/details/77144590 和其它的机器学习方向一样,强化学习(Reinforcement Learni ...
- Cloud Lab: 泰晓实验云台【转】
转自:http://tinylab.org/cloud-lab/ 可快速构建的计算机课程在线实验平台 由 Wu Zhangjin 创建于 2017/10/06 评论 打赏 项目描述 泰晓实验云台 项目 ...
- Ubuntu下常用强化学习实验环境搭建(MuJoCo, OpenAI Gym, rllab, DeepMind Lab, TORCS, PySC2)
http://lib.csdn.net/article/aimachinelearning/68113 原文地址:http://blog.csdn.net/jinzhuojun/article/det ...
- hapi lab测试框架简单使用
1. 依赖安装 yarn init yarn add lab code 2. 基本模式 const Lab = require('lab'); const Code = require('code') ...
- Jupyer Notebook, Jupyter Lab 虚拟环境配置
虚拟环境 conda create -n python36 python=3.6 使用以下命令激活: activate python36 Notebook 安装插件 conda install nb_ ...
- GitHub Learning Lab
GitHub Learning Lab https://lab.github.com/ https://github.community/t5/GitHub-Learning-Lab/bd-p/lea ...
随机推荐
- oracle之集合操作函数---minus、union、intersect
集合操作符专门用于合并多条select语句的结果,包括:UNION,UNION ALL,INTERSECT,MINUS.当使用集合操作函数时,需保证数据集的字段数据类型和数目一致. 使用集合操作符需要 ...
- ( C++) Access the hard drive.
// Open up the volume HANDLE hVolume = CreateFile(wstrPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHA ...
- C# MVC 微信支付之微信模板消息推送
微信支付之微信模板消息推送 今天我要跟大家分享的是"模板消息"的推送,这玩意呢,你说用途嘛,那还是真真的牛逼呐.原因在哪?就是因为它是依赖微信 ...
- OAF_开发系列03_实现OAF如何在保存前判断数据是否存在变更(案例)
2014-06-26 Created By BaoXinjian
- Spark算上下基线
def baseLine(sc: SparkContext): Unit = { println("--------------------baseLine start----------- ...
- 如何让input框自动获得焦点
项目中有个需求 一个用扫描枪输入的input框 为了避免每次都需要人为点击 需要做成当打开页面时该input框自动获取焦点 <input type="text" name= ...
- js判断浏览器
function myBrowser(){ var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 ; if (isOpera) { ret ...
- List subList(startIndex, endIndex);
1. subList(startIndex, endIndex);//startIndex开始,到endIndex结束,不包含endIndex! 2. 集合排序可以实现 java.util.Compa ...
- UEFI+GPT引导实践篇(二):UEFI引导安装64位Win7/Win8
下文是在联想Y480笔记本上以UEFI方式启动安装Windows8的全过程,安装Windows7过程基本相同.注意,如果你的电脑硬盘是MBR分区结构,安装过程中将要删除硬盘上所有数据,请安装前备份硬盘 ...
- 针对“Can't download driver to specified address”错误
当用h-flasher检测flash-id时,可能会出现上述错误,个人认为当提示这个错误时,一般来说是sdram出现了问题,可以看看sdram有没有虚焊,或者周围的电阻电容是否正确. 在后来调板子的过 ...