Go to Post May the road accelerate in the Z direction, and the wind always be from -Y (modernized Irish blessing). - KenWittlief [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 11-11-2004, 22:53
incognito_NICK's Avatar
incognito_NICK incognito_NICK is offline
hidden in the corner
AKA: Nick Ferreira
#0179 (Children of the swamp (swampthing))
Team Role: Programmer
 
Join Date: Nov 2004
Rookie Year: 2002
Location: palm beach gardens
Posts: 15
incognito_NICK will become famous soon enough
Send a message via ICQ to incognito_NICK Send a message via AIM to incognito_NICK
help with programing banner senor.

how do i create a working print statement to see if my banner senors are working? i really have no idea.
(email me if you want to see the code: metalcalibur@gmail.com)
  #2   Spotlight this post!  
Unread 11-11-2004, 23:14
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Quote:
Originally Posted by incognito_NICK
how do i create a working print statement to see if my banner senors are working? i really have no idea.
(email me if you want to see the code: metalcalibur@gmail.com)
First, check that it is working from the indicator lights on the sensor.

After you have done that, and have it wired to a digital input, you have to write code that remembers the prior value and runs the printf() call when it sees the value change. Replace Process_Data_From_Master_uP with the one below, and the two variable declarations:


int old_rc_dig_in10, new_rc_dig_in10;

void Process_Data_From_Master_uP(void) {
Getdata(&rxdata);
if((new_rc_dig_in10 = ((int)rc_dig_in10)) != old_rc_dig_in10) {
printf("rc_dig_in10 = %d\", new_rc_dig_in10);
old_rc_dig_in10 = new_rc_dig_in10;
}
Putdata(&txdata);
}


In the case above, the sensor is wired to digital input 10.
You can generalize this to all of the digital input, RC and OI,
and produce a debugging program for your switches. A
similar thing can be done with analog sensors, but you will
want to add a "sensitivity window" to keep "noise changes"
from causing printf()s galore.

If you want to print the sensor value directly, you must cast
it to an int. printf("%d\n", (int)rc_dig_in10)

Eugene

Last edited by eugenebrooks : 11-11-2004 at 23:21.
  #3   Spotlight this post!  
Unread 17-11-2004, 06:51
incognito_NICK's Avatar
incognito_NICK incognito_NICK is offline
hidden in the corner
AKA: Nick Ferreira
#0179 (Children of the swamp (swampthing))
Team Role: Programmer
 
Join Date: Nov 2004
Rookie Year: 2002
Location: palm beach gardens
Posts: 15
incognito_NICK will become famous soon enough
Send a message via ICQ to incognito_NICK Send a message via AIM to incognito_NICK
Re: help with programing banner senor.

thanks for the help. we needed it.
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
Segway Banner Ad JohnBoucher Dean Kamen's Inventions 3 09-10-2004 14:19
Banner Sensor Programming Problem 2Crisis Programming 4 24-02-2004 13:40
Banner Sensors ESchneider Control System 8 18-02-2004 12:17
banner sensor positioning and times bob1million Programming 4 16-02-2004 13:40
Is there a size regulation for the pit area if we wanted to put up a banner Ragin_Kage General Forum 6 14-03-2002 15:33


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

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