Differences
This shows you the differences between two versions of the page.
Both sides previous revision
Previous revision
Next revision
|
Previous revision
Next revision
Both sides next revision
|
wiki:tcb:tcbinstall:io_ports_ab [2016/05/08 21:04] opadmin [Relay Modules] |
wiki:tcb:tcbinstall:io_ports_ab [2017/07/24 02:30] opadmin [Using an I/O Port as Output] |
| |
{{ wiki:io_input.png?direct&500 |Using an I/O port as an input}} | {{ wiki:io_input.png?direct&500 |Using an I/O port as an input}} |
\\ | |
| |
{{ wiki:keyestudio_analogrotation.jpg?direct&500 |Keyestudio Analog Rotation Sensor}} | |
<html><center></html>//[[http://stores.ebay.com/keyestudio/|Keyestudio]] Analog Rotation Sensor//<html></center></html> | |
\\ | \\ |
| |
{{ wiki:io_switch_knob.jpg?direct&500 |Switch and Pot Example}} | {{ wiki:io_switch_knob.jpg?direct&500 |Switch and Pot Example}} |
<html><center></html>//Example of switch and potentiometer used as inputs//<html></center></html> | <html><center></html>//Example of switch and potentiometer used as inputs//<html></center></html> |
| \\ |
| |
| {{ wiki:keyestudio_analogrotation.jpg?direct&500 |Keyestudio Analog Rotation Sensor}} |
| <html><center></html>//[[http://stores.ebay.com/keyestudio/|Keyestudio]] Analog Rotation Sensor attached with male-to-male servo cable//<html></center></html> |
| \\ |
| |
===== Using an I/O Port as Output ===== | ===== Using an I/O Port as Output ===== |
| |
When an I/O port is set to output, three functions appear in the [[wiki:tcb:operation:functionlist#general_purpose_outputs_a_b|Function List]]: External Output (A or B) - On, Off, or Toggle. You can then assign any trigger to these function to cause the output to turn on, off or toggle. If you wish to connect the output to another microcontroller (such as another Arduino) you can do so directly - just connect the signal pin of the I/O port to the input pin of your other controller, and also make sure both the TCB and the other controller share a ground connection. | When an I/O port is set to output, four functions appear in the [[wiki:tcb:operation:functionlist#general_purpose_outputs_a_b|Function List]]: External Output (A or B) - On, Off, Toggle or Pulse. You can then assign any trigger to these function to cause the output to turn on, off, toggle on/off, or pulse momentarily. The pulse is a momentary change in output state, if you set the output to Default High for example the pulse will momentarily bring the output to ground. |
| |
| If you wish to connect the output to another microcontroller (such as another Arduino) you can do so directly - just connect the signal pin of the I/O port to the input pin of your other controller, and also make sure both the TCB and the other controller share a ground connection. |
| |
However keep in mind these outputs are only rated at 20mA each. That means they will almost surely be inadequate for driving lights, relays or other devices. For that you will need to add an external transistor or MOSFET circuit. A simple 2n2222 transistor circuit will work and there are many schematics on the internet. Or see the [[wiki:tcb:tcbinstall:accessories#mosfet_switch|Accessories]] page for a robust MOSFET switch schematic that you can build. | However keep in mind these outputs are only rated at 20mA each. That means they will almost surely be inadequate for driving lights, relays or other devices. For that you will need to add an external transistor or MOSFET circuit. A simple 2n2222 transistor circuit will work and there are many schematics on the internet. Or see the [[wiki:tcb:tcbinstall:accessories#mosfet_switch|Accessories]] page for a robust MOSFET switch schematic that you can build. |
\\ | \\ |
| |
{{ wiki:ebay_relay_tcb.jpg?direct&400 |Relay Module connected to TCB}} | {{ wiki:relay_tcb.jpg?direct&400 |Relay Module connected to TCB}} |
<html><center></html>//Relay attached to TCB Output A with male-to-male servo cable//<html></center></html> | <html><center></html>//Relay attached to TCB output with male-to-male servo cable//<html></center></html> |
\\ | \\ |
==== Buzzer Module ==== | ==== Buzzer Module ==== |