Quantcast
Viewing all articles
Browse latest Browse all 20046

Re: Tone Library don't work

Try this.  If Galileo is really slow, then you might have to tweak it.

 

  1. void beep (unsignedchar speakerPin,int frequencyInHertz,long timeInMilliseconds)
  2. {  // http://web.media.mit.edu/~leah/LilyPad/07_sound_code.html
  3.    int x; 
  4.    long delayAmount =(long)(1000000/frequencyInHertz);
  5.    long loopTime =(long)((timeInMilliseconds*1000)/(delayAmount*2));
  6.    for(x=0;x<loopTime;x++) 
  7.    { 
  8.   digitalWrite(speakerPin,HIGH);
  9.   delayMicroseconds(delayAmount);
  10.   digitalWrite(speakerPin,LOW);
  11.   delayMicroseconds(delayAmount);
  12.    } 
  13. }

  14. Also see RoboBrrd-Mesh-Network--Pulse-Sensor/LearningPet_XNP/LearningPet_XNP.ino at master · RobotGrrl/RoboBrrd-Mesh-Network--Pulse-Sensor · GitHub

Viewing all articles
Browse latest Browse all 20046

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>