Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18347

How to Play Tone on Intel Galileo?

$
0
0

Hi,

 

Previously on my Arduino, I use these codes below to play tone. The piezo speaker positive pin is connected to pin 10. While the negative pin is connected to pin 9.

 

#include <toneAC.h>

int frequency = 10000; //19000

void playFrequency() {      toneAC(frequency);
}

void setup() { }

void loop() {      playFrequency();
}

 

I am trying to achieve the same thing on the Galelio. However, above codes cannot be executed because ToneAC library is not supported by the Galileo. So, I thought the normal tone would work

 

void setup() { }

void loop() {       tone(8, 1000);
}

Well, sadly, it does not work too. I did a little googling and came across this link. https://communities.intel.com/message/214563 So, it seems that tone() function does not exist. As such, how can I play the piezo speaker with the Galileo?

 

The main reason I used ToneAC on my Arduino previously is because the tone is much smoother at higher frequency as I wanted it to generate tones between 19kHz - 22kHz.

 

Kindly advice me on how do I achieve the same thing with the Galileo?

 

*I accidently marked this as answered*

 

Thank you in advance.


Viewing all articles
Browse latest Browse all 18347


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