ROBOTC.net forums
http://www.robotc.net/forums/

Playtone
http://www.robotc.net/forums/viewtopic.php?f=69&t=9731
Page 1 of 1

Author:  pgregory [ Tue Nov 04, 2014 5:07 pm ]
Post subject:  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

Author:  mightor [ Sun Nov 09, 2014 2:12 am ]
Post subject:  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);
  }
}

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/