|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using a GPIO pin for both input and output.
Our team would like to use an ultrasonic rangefinder that uses the signal pin for both input and output (ping control and echo are on the same data line).
How would you go about using WPILib to switch a GPIO pin between input and output? Specifically, I'd like to do something along the following lines: Code:
DigitalOutput ping(12); Counter echo(12); echo.SetSemiPeriodMode(true); /* ... */ ping.Pulse(pingPulseWidth); double range = echo.GetPeriod(); |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AnalogChannel as both an accumulator AND a normal input? | Jared Russell | C/C++ | 2 | 31-01-2009 10:14 |
| Dashboard Analog Meters and GPIO? | Geek_Girl | Programming | 1 | 17-12-2008 09:50 |
| Analog pin output data | 3DWolf | Programming | 3 | 22-01-2008 10:23 |
| roll pin into output shaft | m1k3 | Kit & Additional Hardware | 18 | 15-01-2008 16:18 |
| using set screw or dowel pin/pin to hold on drill motor coupler thinggy | Travis Covington | Motors | 1 | 04-02-2002 03:02 |