Go to Post Smart defense doesn't even require your robot to push another. - Cory [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 01-02-2008, 23:57
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Ultrasonic sensors on digital ports 3-6 problems

I wrote a program to run this sensor (Parallax PING))) ) for ports 1&2, and it worked fine, but I decided I would rather have them on ports 3-6 and have 1&2 for my encoders, so I re-wrote my code, and now it doesn't work properly. I end up getting one high number when I first turn on the robot, then a steady number of 35 for the distance and 25 for the time. Here is my code:

http://www.easternfront.org/ultrasonic_port_3_6.zip

I had several printf's spread around in it to see if I was getting to all of the places in my code, thats what that phasetest is. My implementation of it in the default routine is:

Code:
if(x==1)
{
    Ping(3);
}

if(x==20)
{
     printf("Distance:%d Time%d\r",Get_Distance(3),Ultrasonic_3_Time);
     x=0;
}
x++;
Any help would be greatly appreciated, thank you.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
 


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
Parallax and Maxbotix ultrasonic sensors Lucretius Programming 5 20-02-2008 14:34
ultrasonic sensor problems... couldntthinkofa Programming 2 05-01-2008 12:29
Ultrasonic range sensors for Vex Robot OneCoolDude Programming 1 01-12-2007 09:22
can we use ultrasonic sensors? GMKlenklen Electrical 20 15-01-2007 14:34
Gryo, Camera, Accelorometer, Ultrasonic, and Gear Tooth Sensors in one program EHaskins Programming 8 22-05-2006 12:08


All times are GMT -5. The time now is 23:53.

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