Go to Post It is great to see your friends and other teams succeed. - Bob Steele [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
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-11-2009, 23:56
MattSr's Avatar
MattSr MattSr is offline
Mentor/Programmer/Animator
AKA: Matt Cyril Senior
FRC #0488 (Team Xbot)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Seattle, Washington
Posts: 21
MattSr is an unknown quantity at this point
Send a message via AIM to MattSr Send a message via MSN to MattSr Send a message via Yahoo to MattSr
[FTC]: A useful VI I created

Here is a subVI I created that i thought would help out anyone using labVIEW

I created it to be used to take the 12 boolean wires outputted from "FTC Read Controller.vi" and convert them from 12 true/false variables, to a binary number, to a base 10 number that you can connect to a case statement to do things such as stop when no buttons are being pressed or do an action when a certain combination of buttons is pressed. It comes with a small guide to help you understand how it is getting its output number and ultimately avoid a lot of unnecessary programming.

Button Config Outputs:

Controller Button - Binary Output - Base 10 Output

1 - 000000000001 - 1
2 - 000000000010 - 2
3 - 000000000100 - 4
4 - 000000001000 - 8
5 - 000000010000 - 16
6 - 000000100000 - 32
7 - 000001000000 - 64
8 - 000010000000 - 128
9 - 000100000000 - 256
10 - 001000000000 - 512
11 - 010000000000 - 1024
12 - 100000000000 - 2048

Add the Base 10 Outputs together to make a specific combination of buttons to be pressed for your case structure

Lets say you want an action to run when you press the buttons 5, 7, 11 and 12, you would add the base 10 values from each button (16+64+1024+2048) together to make the value: 3152

Please leave any questions or comments on this
Attached Files
File Type: zip BoolToNumber.zip (21.1 KB, 21 views)
__________________


Much love to my favorite FRC teams:
1983 Skunkworks - 360 The Revolution - 2898 Flying Hegehogs - 2557 Sota Bots - 2942 Tech Robotics
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FTC]: FTC]: FTC Champ Tournament - Ontario (Scoring Breakdown) Mr. Lim FIRST Tech Challenge 2 03-03-2008 11:54
[FTC]: [FTC]: Ontario Provincial FTC Start/End Times cbhl FIRST Tech Challenge 8 16-12-2007 13:37
What is the most benefitial technological advance ever created? Koko Ed Math and Science 28 05-05-2005 22:52
New Website being created ! mtaman02 IT / Communications 25 26-01-2005 03:37
Sensor Warning-Lighting is not created equal Adam Y. Technical Discussion 9 09-01-2005 18:30


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

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