查看“Microduino Traffic Light Simulation”的源代码
←
Microduino Traffic Light Simulation
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{| style="width: 800px;" |- | ==Purpose== The course will show you how to use Microduino to simulate a traffic light. ==Equipment== {|class="wikitable" |- |Module||Number||Function |- |[[Microduino-Core]]||1||Core board |- |[[Microduino-USBTTL]] ||1||Program download |} *Other equipment {|class="wikitable" |- |220Ω resistor||One |- |Breadboard jumper||One box |- |USB cable||One |- |Red LED||Two |- |Yellow LED||Two |- |Green LED||Two |- |White LED||Two |- |Breadboard||One |} ==Schematic== [[File:trafficLightSechmatic.png|600px|center|thumb]] As the pictures show: Red light—Stop Yellow—Wait to turn color Green—Go The driving light—white light together with blinking red light reminds pedestrians to stop. Just like this: [[File:trafficLightSechmaticsw.jpg|600px|center|thumb]] ==Program== [[https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Advanced_Tutorial/MicroduinoTrafficLight MicroduinoTrafficLight]] ==Debugging== Step 1: Build the circuit according to the schematic, as follows: [[File:trafficLight1.png|600px|center|thumb]] Step 2: Download the code and run after compiling. [[File:trafficLight2.png|600px|center|thumb]] Step 3: Function description Here in this example, we simulate two traffic lights and define four circumstances in the code: 1.When traffic light 1 goes on and the driving lamp blinks, it means “Stop”; At same the time, the second green light in traffic light 2 goes on, it means “Go”. 2.When the red light goes off and the yellow light goes on in traffic light 1, it means “Ready to go”. At the same time, the yellow light in traffic light 2 goes on, meaning “Ready to stop”. 3.When green light in traffic light 1 goes on, it means “Go”. The red light goes on and driving lamp blinks in traffic light 2, it means “Stop“. 4.When the yellow light in traffic light goes on, it means “Read to stop”. Meantime, the red light goes off and yellow light goes on in traffic light 2, it means “Ready to go”. The variable “duration” in the code defines duration time of each circumstance: int duration[] = { 8000,3000,10000,3000}; // duration of each situation [[File:trafficLight3.jpg|600px|center|thumb]] From the crossroads picture above, you can see two traffic lights in this example are in different direction. ==Result== Two traffic lights will simulate traffic lights in two directions at the crossroads as well as how they work in real life. ==Video== http://v.youku.com/v_show/id_XODQ5NTcwOTg4.html |}
返回至
Microduino Traffic Light Simulation
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
Welcome
首页
创客大赛
大赛详情
3D打印
安装月球车
图形化编程
操控月球车
升级月球车
编程工具下载
软件下载
Arduino
Processing
Mixly
Scratch
模块套件
Microduino 102
mCookie 102
mCookie 202
mCookie 302
IBC
其他
应用套件
四轴飞行器
平衡车
小车CUBE
音乐播放器
刷卡音乐播放器
wifi气象站
彩虹音乐触摸灯
分贝检测仪
迎门汇报
LED点阵时钟
LED点阵屏幕
硬件
mCookie
Sensor
Microduino
MicroWrt
MicroNux
MicroRobot-Core
MicroRobot-CoreESP
ideaBoard
ideaBox
MicroMV
MicroAI
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息