非常急 是英文的 求各路大神帮助啊!!!!!!-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 4473|回复: 4

[已解决] 非常急 是英文的 求各路大神帮助啊!!!!!!

[复制链接]
发表于 2014-2-5 09:08 | 显示全部楼层 |阅读模式
( 我第一次接触这个, 老师就叫写 , 我完全不懂这是什么 ,一片茫然, 如果有大神知道 请求告知。 感激不尽!!!!!! 以下是4个要写的程序)

1.Write a program to con gure pin PB1 as an output. Toggle PB1 high-low repetitively as fast
as possible, this will result in a square wave. With an O-scope measure the period of the square
wave. Comment on the frequency of this square wave and if it falls within your expectations
given the C is running at 16 MHz (i.e. how many cycles do you estimate your loop is taking).
Comment on the duty cycle of the square wave, if it is not 50% explain why. Include an O-scope
screen capture of the signal on PB1.  

2.Use the output pin PB1 and an O-scope to create our own delay function. Create a function void
myHardDelay(uint32 t delayInMsec), when called will delay an integer number of milliseconds
before returning. Inside the function create a delay by looping N * delayInMsec times. You will
have to experiment to nd a value N that provides an accurate delay function. This function
should now be used in future projects, replacing the Arduino wiring library function delay().
What is your value for N? Using your delay function create a 100 Hz square wave on PB1 and
include an O-scope screen capture. How accurate is your delay function at 1 and 1000 msec's?
What it the maximum delay of your myHardDelay()?


3.Write a function to de-bounce the input pin PB0. Once you de-bounce the pin, if there is a
change in the status write a message to the serial monitor program using the USART (you
may use the Arduino wiring library for this). Test your input with a push button connected
to ground. Enable the internal pull up on PB0. Make sure your de-bounce function doesn't
report false presses or releases of your button. You will use this function in future programs
and want to accurately detect when a button is pressed and released with out repeats of the
event or missing it altogether. How long was your delay between reads of the input pin and
why did you choose that value?

4.Use PB0 and PC0 as inputs to control two LED's that are attached to PD6 and PD5. PD6
LED should be an OR of the two inputs. The PD5 LED should be an AND of the two inputs.
When a de-bounced input change is detected on either PB0 or PC0 write a debug message
using the Arduino wiring library and the serial monitor program to view it. (Hint: You will
need a breadboard, 2 LED's and 2 current limiter resistors. Don't forget to current limit each
LED with a resistor). What is the value of your current limiting resistor and why did you
choose that value? What is the max current the ATmega328P can source and sink per GPIO
line (Hint: Look at the data sheet )? Does your program behave as expected?



发表于 2014-2-5 13:16 | 显示全部楼层
你至少也得翻译出来,再求助吧,中文社区,不是每个人都懂英语
发表于 2014-2-9 20:02 | 显示全部楼层
看样子很简单 可惜看不大懂英文
发表于 2014-2-11 10:58 | 显示全部楼层
本帖最后由 kevinzhang19701 于 2014-2-11 11:22 编辑

congure是啥意思?

With an O-scope measure the period of the squarewave. 这个不成句子,楼主哪里拷贝来的?
发表于 2014-2-12 13:00 | 显示全部楼层
1.老师是教英语的吗?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-12-4 17:55 , Processed in 0.086322 second(s), 17 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表