Go to Post I told myself I'd stay out of the obsession this year, but I couldn't resist... - Grant Cox [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-02-2011, 13:41
microeyes360 microeyes360 is offline
Registered User
FRC #3687
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Schenectady
Posts: 1
microeyes360 is an unknown quantity at this point
Photoswitch value?

I know that when calibrated, the photoswitches will shine yellow/orange when over tape, and green when over the carpet.
I just need to know what default value they will return when over both surfaces. The get() method of DigitalInput returns a boolean value, but which condition will return true, and which false. I am guessing that tape returns true, but I really can't test it until the competition since my team does not have access to these materials.
Anybody know?

Also, first post on these forums!

Last edited by microeyes360 : 19-02-2011 at 13:44.
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2011, 13:47
Patrickwhite's Avatar
Patrickwhite Patrickwhite is offline
May the North be with you
FRC #0610 (The Coyotes)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Toronto
Posts: 88
Patrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of light
Re: Photoswitch value?

Congratulations on your first post!

What the sensors return depends on how they are wired. Ours originally returned true when over the carpet (green) and false when over the tape (yellow), but now it's the other way around. Write your code so it's easy to change, and test at competitions.
__________________
while(!going.isTough());
tough.exit();

What will we do tonight, Warfa?
The same thing we do every night, Patrick. Sit and wait for Electrical.
Reply With Quote
  #3   Spotlight this post!  
Unread 20-02-2011, 15:31
Hadyn Fitzgeral Hadyn Fitzgeral is offline
Registered User
None #1234
 
Join Date: Feb 2011
Rookie Year: 2013
Location: No where
Posts: 3
Hadyn Fitzgeral is an unknown quantity at this point
Re: Photoswitch value?

A Photoswitch Has 2 Values

On and Off

Or 0/1

This can be translated into binary and using a bitmask we can get values either know as Opcodes to translate into robot movement.

byte mask = 0;

if(sensor0 is active)
mask |= 0x1;

if(sensor1 is active)
mask |= 0x2;

if(sensor2 is active)
mask |= 0x4;

return mask;

MIN OPCODE = 0, MAX OPCODE = 7 [2^0 + 2^1 + 2^2]
Reply With Quote
Reply


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


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

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