|
Page 1 of 1
|
[ 5 posts ] |
|
Author |
Message |
RobotMaster98
Rookie
Joined: Wed Jun 19, 2013 5:57 pm Posts: 25
|
 sonar sensor in inches
Is there any way to to program with the US (sonar) sensor in inches instead centimeters? or do i have to convert it
_________________ -TheRobotMaster (or soon to be one)
FRC Team #2550 Skynet -Programmer 2013 - present Website [url]sites.google.com/site/2550robotics[/url]
FTC Team #4508 E=MC^Squirreled -Second Programmer 2013-2014
FLL Team #3414 Team Brickstein -Mentor
|
Mon Jun 24, 2013 8:55 pm |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: sonar sensor in inches
I don't believe there's a way you can. But a quick little function will take care of that for you. At least I assume it works... Let me know if it does 
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Mon Jun 24, 2013 9:45 pm |
|
 |
jbflot
Site Admin
Joined: Tue May 15, 2007 9:02 am Posts: 409
|
 Re: sonar sensor in inches
The virtual worlds only returns the value in centimeters. Like NeXT-Generation suggested, you can convert the value. I haven't tested his code but I suspect that you'll want the return type to be a float, not a byte.
|
Thu Jun 27, 2013 10:35 am |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: sonar sensor in inches
You might, but I was thinking that if you're going with decimals of inches you might as well be using centimeters.
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Thu Jun 27, 2013 10:45 am |
|
 |
Ernest3.14
Professor
Joined: Sat May 18, 2013 1:24 pm Posts: 271 Location: Olympia, WA
|
 Re: sonar sensor in inches
Agreeing with NeXT-Generation. The code snippet provided is more than adequate, and if you're annoyed by it just add another one like "readUS()" which outputs in inches.
_________________FTC Team 6424, the 'Oly Cow - Chief programmer. FRC Team 4450, Olympia Robotics Federation (ORF). and also quadrotors. Quadrotors!
|
Thu Jun 27, 2013 2:58 pm |
|
|
|
Page 1 of 1
|
[ 5 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|