View unanswered posts | View active topics It is currently Sun Sep 22, 2019 10:39 pm






Reply to topic  [ 2 posts ] 
Playtone 
Author Message
Rookie

Joined: Tue Nov 04, 2014 5:04 pm
Posts: 2
Post Playtone
I am trying to make it so when our robot backs up it will use playtone to make the backing up sound that large trucks have, however i can't figure out what the tone is and was wondering if anyone knew. If there is a .wav file i should download that you know that would be helpful


Tue Nov 04, 2014 5:07 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Playtone
Try this program:

Code:
#pragma config(Sensor, port1,  touch,          sensorVexIQ_LED)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

bool bBeepEnabled = false;

task beepbeep()
{
  while (true)
  {
    if(bBeepEnabled)
    {
      playSound(soundWrongWay);
      sleep(500);
    }
  }
}

task main()
{
  bPlaySounds = true;
  startTask(beepbeep);
  while (true)
  {
    if (getTouchLEDValue(touch) == 1)
      bBeepEnabled = true;
    else
      bBeepEnabled = false;
    sleep(50);
  }
}

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Nov 09, 2014 2:12 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.