Can you make 2 tones in SimpleIDE?
Mr. Lewis
Posts: 24
I am a teacher and have been using the 6 pre-release chapters of the WAMM booklet to start teaching C to some of my more advanced students. All of the students are familiar with PBasic and have been programming for over a year now.
My problem: I am trying to have them adapt PBasic FREQOUT programs from the WAM book into C on SimpleIDE. I know you can have multiple frequencies on the same line in PBasic, but this function does't seem to work on the SimpleIDE. Is there another command that students can use, or do I just need to get them through the basics, then move onto .wav files?
Thanks for any help.
My problem: I am trying to have them adapt PBasic FREQOUT programs from the WAM book into C on SimpleIDE. I know you can have multiple frequencies on the same line in PBasic, but this function does't seem to work on the SimpleIDE. Is there another command that students can use, or do I just need to get them through the basics, then move onto .wav files?
Thanks for any help.
Comments
We have a different library for two (actually up to four) tones, and that's the next thing I'm going to add to the WAMM draft, along with speech and playing a .wav file. The example programs use a C language port of some of the Spin language libraries Brett Weir wrote for his LameStation project.
The example programs and library are in this file 07 Audio (2016.02.10).zip. Make sure to unzip 07 Audio.zip, and work from the folder that gets created, not from inside the zip itself.
You can either make sure all your projects are in the same folder as libsound, or copy the libsound folder from ...07 Audio\ to ...Documents\SimpleIDE\Learn\Simple Libraries\Audio\. After copying the libsound folder over and restarting SimpleIDE, it won't matter where you create your projects, they'll still be able to access the library if you add #include "libsound.h" to source code.
Plug a speaker or headphones into the Activity Board's jack.
Try the nine example programs in the 07 Audio folder. Please disregard the comments about the badge and oLED display.
You can also drive both sides of a piezospeaker by connecting an I/O to each terminal, then use the I/O numbers in sound_run.
Andy
Tim