Airkraft-NXTs Lego Mindstorms NXT Forum
Airkraft-NXT.comAirkraft-NXT.com  ­HomeHome  ­PortalPortal  ­GalleryGallery  ­SearchSearch  ­FAQFAQ  ­RegisterRegister  ­MemberlistMemberlist  ­UsergroupsUsergroups  ­Log inLog in  
Post new topic   Reply to topicShare | 
 

 changing the pitch of a tone in accordance to distance help

View previous topic View next topic Go down 
AuthorMessage
Airkraft-NXT
Admin


Number of posts: 23
Location: Northampton
Registration date: 2007-12-24

PostSubject: changing the pitch of a tone in accordance to distance help   Fri Dec 28, 2007 12:41 pm

I am currently working on a project where my robot needs to be able to produce a tone that changes pitch according to the distance it is from an object.

Attached is a picture of part of the programming. However, I dont think this is right. For I only get two pitches: high or low. If anyone can tell me how to use data wires, or if there is another method of changing the pitch in accordance to distance, the I would be extremely gratefull.

Airkraft-NXT
Back to top Go down
View user profile http://www.airkraft-nxt.webs.com
The_System_Programmer



Number of posts: 4
Location: USA
Registration date: 2008-03-05

PostSubject: Re: changing the pitch of a tone in accordance to distance help   Sat May 10, 2008 3:55 am

since i've moved to robotc i'm not as fluent in NXT-G any more but try and get rid of the touch sensor (just in case).

in robotc all you woluld do is:

task main(){
while(true){
PlayTone(SensorValue[S4], 1);}//S4 is for sensor port 4
}
this is alot simpler i think than all of those pictures and lines of color, it's just line after line of code lol!

_________________
-The_System_Programmer (AKA Caboose)
Back to top Go down
View user profile http://thesystemprogrammer.webs.com/
mike1



Number of posts: 2
Location: Eastern US
Registration date: 2008-07-25

PostSubject: Re: changing the pitch of a tone in accordance to distance help   Fri Jul 25, 2008 9:59 pm

You should try downloading the source code for the firmware it includes an NXT-G program of the light sensor try me program. It may take a while for you to find it. Though it should be at: LEGO MINDSTORMS NXT Firmware Open Source\AT91SAM7S256\Resource\TRYME PROGRAMS
Back to top Go down
View user profile http://nxt-r.webs.com
 

changing the pitch of a tone in accordance to distance help

View previous topic View next topic Back to top 
Page 1 of 1

Permissions of this forum:You cannot reply to topics in this forum
Airkraft-NXT's Lego Mindstorms Forum :: Lego Mindstorms NXT :: Programming-
Post new topic   Reply to topic