Go to Post I have some free time tonight (What?) - Brandon Martus [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-01-2007, 16:22
Robostang 548's Avatar
Robostang 548 Robostang 548 is offline
I can program the future...
AKA: Don
FRC #0548 (Robostangs)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Northville Mi
Posts: 69
Robostang 548 is on a distinguished road
Send a message via AIM to Robostang 548 Send a message via MSN to Robostang 548 Send a message via Yahoo to Robostang 548
Question Digital IO Agggggggggggg!

My team can’t seem to be able to get the digital IO ports working. We made a printf statement that just displays the state of digital_io_01 and also made the switch 2 led = to the state of digital_io_01. The led and the terminal window both say that digital_io_01 = 1. At first we thought that this was weird because there was no switch or anything attached that would close the circuit and make it 1. We attached a pwm cable and tried jumpering red to white and then tried to jumper black to white but there was no change in the state of digital_io_01. We have it configured as an input but we can’t seem to get the state of digital_io_01 to change from 1. How are we supposed to hook switches and other sensors that run on an on off basis to the Digital IO pins and get them to work. Also, in an unrelated question, how are we supposed to hook up a pot or other analogue sensor to the analogue input pins?
  #2   Spotlight this post!  
Unread 27-01-2007, 17:44
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,587
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Digital IO Agggggggggggg!

Second question first. The Robot Controller Reference is your friend. Check page 9.

First question. This should be working. So I have a few questions for you. Are you certain you're properly setting it to an input? Are you sure you're not setting it to an output somewhere just after that? Are you sure you're not sending a value to the variable in you code anyways? And finally, are you sure the PWM is plugged in the right way and in the right port?

Otherwise, yes shorting black to white should change the input from 1 to 0. The input is 1 normally because the the pin has a pull up resistor on it that pulls the value up to 5V when there's nothing connected.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #3   Spotlight this post!  
Unread 27-01-2007, 18:25
Michael DiRamio Michael DiRamio is offline
Registered User
FRC #1114 (Simbotics)
Team Role: Teacher
 
Join Date: Jan 2006
Rookie Year: 2006
Location: St. Catharines, Ontario, Canada
Posts: 39
Michael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond repute
Re: Digital IO Agggggggggggg!

digital_io_01 is used to set the pin to either INPUT or OUTPUT.

To actually read it once you have it set to input, you read it through rc_dig_in01.

If you were to set it to output instead, you set the value to rc_dig_out01.
  #4   Spotlight this post!  
Unread 31-01-2007, 22:06
mandrews281 mandrews281 is offline
Registered User
FRC #0281
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Greenville SC
Posts: 82
mandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to behold
Re: Digital IO Agggggggggggg!

Quote:
digital_io_01 is used to set the pin to either INPUT or OUTPUT.

To actually read it once you have it set to input, you read it through rc_dig_in01.

If you were to set it to output instead, you set the value to rc_dig_out01.
Michael

You just solved one nagging bug from our 2006 code. Our 2007 code thanks you.
Closed Thread


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
Digital Caliper as a Digital Readout on Small Mill sanddrag Technical Discussion 9 13-10-2005 22:51
Digital Cameras Ian W. Chit-Chat 15 08-09-2004 17:48
Digital In Question Tom Bottiglieri Control System 5 02-03-2004 17:09
digital i/o connectors Mercutio Electrical 4 19-01-2004 19:20
Digital Cameras Clark Gilbert Chit-Chat 16 07-12-2003 22:59


All times are GMT -5. The time now is 02:30.

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