![]() |
0 or 1?
Is a signal of +5V as opposed to 0V considered a digital 1 or a digital 0? Or does it depend on where? If so, can someone detail when +5V is 1 and when it's 0? I've been confused about this for a while...
|
Re: 0 or 1?
Quote:
|
Re: 0 or 1?
Commonly:
+5V is a digital 1 0V is a digital 0 This is the case in the FIRST robot controller. There are other protocols and standards that use different voltage levels to represent 1's and 0's, but I'm not aware of anything in the FIRST RC that is not 5V/0V. As was mentioned before: remember that if you connect nothing to an input, they will default to +5V (not 0V) when the controller is on. Good luck! David A. |
Re: 0 or 1?
with digital logic the higher voltage signal is always called 1 or H, and the low voltag signal is always 0 or L.
The thing that is sometimes confusing is some signals are active low. For example, reset signals are usually active low. That simply means when you pull the signal low, the device is reset. Active low signal names usually have a line over the name (not easy to do in a text editor) or the letter L or N tagged on the end, like: RESET_L. There are electrical reasons why you would sometimes want a signal to be active low intsead of the normally active high, but it would take about a page of this thread to really explain it. |
Re: 0 or 1?
Quote:
What you're describing is called positive logic and is how most digital circuits work, including most of the Robot Controller. However, negative logic exists as well. RS-232 serial communication uses negative logic, with a positive voltage being logic 0 and a negative voltage being a logic 1. |
Re: 0 or 1?
the best thing is (i know this isn't quite an answer) to test the device with a printf and find out when it returns 1 and when it returns 0
|
Re: 0 or 1?
Quote:
What you're probably really interested in is this: when that switch is not pressed, what is the RC hearing? When it IS pressed, what is the RC hearing? I use the word Code:
"hearing"This is most easily tested through the use of the wonderful and beautiful Ms. Printf (I'm in a valentiny mood here). Also, use #defines to good advantage so that you don't have to change a bunch of stuff! Self-discovery for the win! Best of luck, Paul Dennis |
| All times are GMT -5. The time now is 01:33. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi