MrDEB
Well-Known Member
Want to build a "busy box" for my new grandson and could just go with Ardunio but I understand there is more to it than just having a PCB made for the Amtel chip so looking at using an 18f43k22 pic and swordfish basic. Have lighted buttons and play tunes but haven't figured out how to include a CONST ARRAY of frequencies and use them to play a tune.
Using a passive buzzer as per the Ardunio sketch but including the frequencies.
here is a snippet of proposed Ardunio code.
Hopefully I can use different tunes for different melodies.
I have found several similar projects but still need to use the frequencies in a CONST array but ??
Using a passive buzzer as per the Ardunio sketch but including the frequencies.
here is a snippet of proposed Ardunio code.
Code:
int frequency(char note)
{
int i;
const int numNotes = 8; // number of notes we're storing
char names[numNotes] = {
'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };
int frequencies[numNotes] = {
262, 294, 330, 349, 392, 440, 494, 523 };
I have found several similar projects but still need to use the frequencies in a CONST array but ??