Go to Post There is no rule that specifically states that you must obey the law of physics during the competition. This may be an oversight. - bmather [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 11-02-2004, 13:31
emusteve's Avatar
emusteve emusteve is offline
Registered User
AKA: Steve Martin
#0470 (Alpha Omega)
 
Join Date: Jan 2004
Location: Ypsilanti
Posts: 66
emusteve is just really niceemusteve is just really niceemusteve is just really niceemusteve is just really nice
Problems reading io pins as a group

I'm trying to read a group of 4 io pins to get a numerical value as the status of an outboard device. I'm trying it out using the edubot controller so I'm looking at io pins 1-4 which translates to PortA bits 0-3. I was trying to do the following:

sensor_value = (PORTA & 0x0f);

iIt compiles ok, but the result is always 0. I double-checked that I have set the pins to INPUT, and have set the number of analog channels to NO_ANALOG. sensor_value is an unsigned char.

I also tried reading the pins individually as rc_dit_in01 through rc_dig_in04 and got the proper values, so I know the hardware is ok. Anyone know what gives here? Any help would be appreciated.


On another note, I often have problems getting the edubot to take to a program upload. Sometimes it takes 2 or 3 tries before it will run. And it won't hold through a power-down. Do I just have a bad machine? this is true for a fresh load of the Default Code as well as my own, and the same behavior with both versions of the IFI Loader.
 


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
TTL pins Dave... Control System 3 07-02-2004 23:59
Joystick problems archiver 2001 3 24-06-2002 02:40
Hits, Misses, & Suggestions -- long message archiver 2000 17 23-06-2002 23:36
Nationals a la NCAA archiver 2000 20 23-06-2002 22:25


All times are GMT -5. The time now is 08:55.

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