华中科技大学C51单片机应用与C语言程序设计课件-总纲.ppt

华中科技大学C51单片机应用与C语言程序设计课件-总纲.ppt

  1. 1、本文档共54页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
单片机AT89S52的四个端口P0、P1、P2和P3是可以按位来操作,从低到高依次为第0口、第1口……第7口,书写分别为PX.0、PX.1、……、PX.7(X取0到3)。 P10x10和P20x08分别提取了P1.4和P2.3的值,屏蔽了其他位。 * Suggest that they reopen FlashLed.bs2, and modify the contents of the DO…LOOP according to what’s shown. Remind them to rename it. This time, it’s PushbuttonControlledLed.bs2 Explain how the IF statement is used to make decisions. * Explain that they can add specific conditions using the ELSEIF keyword. After they appear to understand this code segment, explain the problem about pressing and holding both pushbuttons. Show them this program in the stamp editor and have them think about how to detect if both pushbuttons are pressed. Explain that that is yet another way IF…ELSEIF…ELSE can be used. Explain that time will probably not permit, but there is also a reaction timer game that involves an LED that changes color and a program that tracks how long it takes between the time the LED changes color and the user lets go of the pushbutton. Open WAM and show how the chapters are split into activities. Explain that the first activity is usually a hands-on, minimal or no programming exercise. The last activity is typically an application example that involves something fun and interactive for the students, such as a reaction timer game. * Introduce that the Debug Terminal can be used to send messages to the BASIC Stamp as well as display messages from the BASIC Stamp. Explain that the DEBUGIN command causes the BASIC Stamp to wait until a message is typed into the upper windowpane of the Debug Terminal. Show how to resize this window using the separator bar between the two windowpanes. Explain how this example can be used to better understand the relationship between pulse width and servo position as well as repetitions and hold-time. * REMEMBER: Only disconnect the pushbutton circuits. Leave the servo and LED. Introduce that the BASIC Stamp is designed to take RC decay measurements very efficiently, and that it uses a circuit that behaves

文档评论(0)

一天一点 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档