Digital Sensors

You can also add additional sensors or switches to your CBC, and you plug them into the slots labeled “digital.”

In C you call them by digital(x); where x is the number of the digital sensor port (8-15), and the function will return a value of 1 if the sensor is activated or a 0 if it is not.

An example of a a digital sensor is a switch or a button. Such as used in bumper sensors. Digital sensors either are yes or no, and nowhere in between. It’s black and white. For the gray in between – go to the next lesson: analog sensors.

NEXT: Analog Sensors

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s