Robofun 機器人論壇

標題: HIGH和LOW的問題... [打印本頁]

作者: Dr.J    時間: 2010-8-5 15:20
標題: HIGH和LOW的問題...
Arduino輸入腳位怎麼判定1(High) or 0(Low)
是看輸入時的電壓高於多少嗎@@?
因為正在學習控制板...但不知道這個地方要怎麼判定...
作者: aroboto    時間: 2010-8-5 16:20
對的~
如果控制器是5V控制環境   HIGH-->5V
如果控制器是3.3V控制環境   HIGH-->3.3V
作者: Dr.J    時間: 2010-8-5 16:57
0.0...控制器是指Arduino的整塊板子嗎?
剛剛是做了一些試驗...Arduino控制板(應該都是5V吧?)輸入腳位的是由反相器IC(4.5V供電)的輸出進入...
他對於我寫的程式有HIGH的反應...所以挺疑惑的是範圍值多少都能代表HIGH...表達不好請見諒= =""
作者: g921002    時間: 2010-8-5 22:05
以5V系統來說,看是CMOS的IO還是TTL的IO。
CMOS的HIGH在0.7VCC左右,TTL則在2.5以上就為HIGH。
到底是那種,看規格書就知。
作者: Dr.J    時間: 2010-8-5 22:21
Arduino Duemilanove ATMEGA 328
買來就整塊Arduino控制板...沒有規格書(炸....
作者: tommylin    時間: 2010-8-5 22:27
Dr.J 大大...
你是指買來沒有附送紙張資料嗎? 很環保阿..
全部的資料包含範例,電路圖,所有的資料都在網站 www.arduino.cc,
多到看不完 @@
作者: Dr.J    時間: 2010-8-5 22:55
抱歉我英文不好...用翻譯軟體...內容太奇怪...所以只能找你們幫忙...謝謝QQ
作者: aroboto    時間: 2010-8-6 17:49
http://www.atmel.com/dyn/resources/prod_documents/doc8025.pdf
規格書這裡有~~~@@

一般產品資訊裡都有@@
作者: aroboto    時間: 2010-8-6 18:24
http://arduino.cc/en/Reference/Constants

HIGH


The meaning of HIGH (in reference to a pin) is somewhat different depending on whether a pin is set to an INPUT or OUTPUT. When a pin is configured as an INPUT with pinMode, and read with digitalRead, the microcontroller will report HIGH if a voltage of 3 volts or more is present at the pin.


A pin may also be configured as an INPUT with pinMode, and subsequently made HIGH with digitalWrite, this will set the internal 20K pullup resistors, which will steer the input pin to a HIGH reading unless it is pulled LOW by external circuitry.


When a pin is configured to OUTPUT with pinMode, and set to HIGH with digitalWrite, the pin is at 5 volts. In this state it can source current, e.g. light an LED that is connected through a series resistor to ground, or to another pin configured as an output, and set to LOW.


數位輸入腳位: 輸入時3V以上 就會認定為 HIGH
數位輸出腳位: HIGH時 輸出5V
作者: Dr.J    時間: 2010-8-12 23:31
謝謝aroboto大大^^幫忙~




歡迎光臨 Robofun 機器人論壇 (https://robofun.net/forum/) Powered by Discuz! X3.2