Go to Post Being inspired is a lot like learning, not everybody does it the same way. - Jay Trzaskos [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 19-02-2009, 13:09
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
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();
This is very easy to do with most microcontrollers, but I can't see an easy way to do this with WPILib. Any tips from the WPI guys?
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 18:17.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi