Here's a sound demo (yankeedoodle) for 12F675...
http://www.picbasic.co.uk/forum/showthread.php?t=64
Here's a sound demo (yankeedoodle) for 12F675...
http://www.picbasic.co.uk/forum/showthread.php?t=64
Thanks Melanie the kids loveed it just wondering it a LCDOUT command "yankie doodle xxxxxxxx"could be put at the beginning and another one after Data $01,$52,$4E,$20"stuck a feather in his capxxxxxx"
to show the words
Last edited by trying; - 18th May 2006 at 14:13.
May be here also ...
http://www.rc-float-flying.rchomepag.../PIC/Sound.htm
héhé,
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
It's a tiny little music routrine that reads four Bytes from EEPROM and acts on it. If you changed it say to FIVE bytes, then use Byte5 (if say non-zero) to indicate what you want to display. Kinda tough on a 12F chip, because lack of pins means you're having to drive a Serial LCD to send your message, and the Serial LCD will take time (even at 9600 baud), so it will impact on the music giving you an abnormal pause between notes. Better if you choose a PIC with more pins.
Sorry Melanie
I was going to use a 16f630. and not use the words in real time
lcdout $FE,1 "yankiexxxxxxxx"
lcdout $FE, $C0 "xxxxxxpony"
displayed then start the music
but I not sure how to insert the second
lcdout $FE,1 "stuckxxxxxxxx"
lcdout $FE, $C0 "xxxxxxmacorone?"
after the $20 Gf7
this is for 5 years olds it can miss a beat or two. LAL
thanks for anyhelp
That's really simple, tear the code appart and you discover that variable CounterA is a pointer into EEPROM starting at Address location 1 (for the first line)...
CounterA=1
Then after each note is played, we increment it by four...
CounterA=CounterA+4
So CounterA is pointing to the note currently being played... simply do something like this...
Only on this forum... rocket science for 5-year-olds (by five year olds!!).Code:MusicalLoop: If CounterA=1 then LCDOut $FE,1,"Yankee Doodle" If CounterA=17 then LCDOut $FE,$C0,"went to town" If CounterA=33 then LCDOut $FE,1,"A-riding on",$FE,$C0," a pony" If CounterA=57 then LCDOut $FE,1,"Stuck a feather" If CounterA=73 then LCDOut $FE,$C0," in his hat" If CounterA=85 then LCDOut $FE,1,"And called it",$FE,$C0," macaroni. Read CounterA,NotePeriod.Highbyte If NotePeriod.Highbyte=$FF then LCDOut $FE,1 Pause 2000 Goto RestartLoop endif Read CounterA+1,NotePeriod.Lowbyte Read CounterA+2,CounterB NoteRepeat=CounterB*10 Read CounterA+3,CounterB MessagePrompt=MessagePrompt+1 NotePause=CounterB*10 CounterA=CounterA+4 MessageNote Gosub PlayNote Goto MusicalLoop
If you want to go more advanced... you can have the words appearing prior to every note...
Code:If CounterA=1 then LCDOut $FE,1,"Yan" If CounterA=5 then LCDOut "kee " If CounterA=9 then LCDOut "Doo" If CounterA=13 then LCDOut "dle" If CounterA=17 then LCDOut $FE,$C0,"went " If CounterA=21 then LCDOut "to " If CounterA=25 then LCDOut "town" etc etc
Melanie your wonderful (bet you get told that a lot) it worked like charm!
Now the grand kids will have there very own Karoke machine
made by Papa
Bookmarks