Hello everyone,
I just bought the subject item at Fry's Electronics:
http://www.frys.com/product/6726995;jsessionid=jChdtuzzoKANrd8+LpeFyQ__.node2?site=sr:SEARCH:MAIN_RSLT_PG.
Mfr: PARALLAX
Parallax Model: 27977-RT
FRYS.com #6726995
UPC: 644890279773
And using the info I found at parallax.com
Ardunio example:http://learn.parallax.com/kickstart/27977
Decimal Command Codes:http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/27976-7-9-ParallaxSerialLCD-v3.0.pdf
Musical Notes:http://forums.parallax.com/showthread.php?139362-Parallax-2x16-Serial-LCD-(27977)-Backlit-w-Spkr-Example-Prop-snd-SPIN-code
I was able to make a Happy Birthday song by doing the following.
1)Found the musical notes for the song on the internet. Happy Birthday to You Sheet music for Piano - 8notes.com
2)Converted the notes to decimal command codes (both lenghth and tone) (see image below).
3)Typed it into the IDE (see code below).
4) Uploaded to the Arduino UNO.
Steps 1 and 4 are fairly easy, but steps 2 and 3 were very time consuming.
MY QUESTION: Anyone know or have suggestions of an easier way of doing steps 2 and 3?
I've included the code and image.
const int TxPin = 6;
#include <SoftwareSerial.h>
SoftwareSerial mySerial = SoftwareSerial(255, TxPin);
void setup() {
pinMode(TxPin, OUTPUT);
digitalWrite(TxPin, HIGH);
mySerial.begin(9600);
delay(100);
mySerial.write(12); // Clear
mySerial.write(17); // Turn backlight on
delay(5); // Required delay
mySerial.print("Happy Birthday"); // First line
mySerial.write(13); // Form feed
mySerial.print("Happy Birthday"); // Second line
mySerial.write(216); // Select the 4th scale (A = 440Hz)
/*
Scale A A# B C C# D D# E F F# G G#
4 440 466 494 523 554 587 622 659 698 740 784 831
*/
//1
mySerial.write(211); // 1/8 note (this should be 3/18, but I don't know the “set length” command for it)
mySerial.write(223); // C tone
//2
mySerial.write(210); // 1/16 note
mySerial.write(223); // C tone
//3
mySerial.write(212); // 1/4 note
mySerial.write(225); // D tone
//4
mySerial.write(212); // 1/4 note
mySerial.write(223); // C tone
//5
mySerial.write(212); // 1/4 note
mySerial.write(228); // F tone
//6
mySerial.write(213); // 1/2 note
mySerial.write(227); // E tone
//7
mySerial.write(211); // 1/8 note (this should be 3/18, but I don't know the “set length” command for it)
mySerial.write(223); // C tone
//8
mySerial.write(210); // 1/16 note
mySerial.write(223); // C tone
//9
mySerial.write(212); // 1/4 note
mySerial.write(225); // D tone
//10
mySerial.write(212); // 1/4 note
mySerial.write(223); // C tone
//11
mySerial.write(212); // 1/4 note
mySerial.write(230); // C tone
//12
mySerial.write(213); // 1/2 note
mySerial.write(228); // F tone
//13
mySerial.write(211); // 1/8 note (this should be 3/18, but I don't know the “set length” command for it)
mySerial.write(223); // C tone
//14
mySerial.write(210); // 1/16 note
mySerial.write(223); // C tone
mySerial.write(217); // Select the 5th scale (A = 880Hz)
/*
Scale A A# B C C# D D# E F F# G G#
5 880 932 988 1047 1109 1175 1245 1319 1397 1480 1568 1661
*/
//15
mySerial.write(212); // 1/4 note
mySerial.write(223); // C tone
mySerial.write(216); // Select the 4th scale (A = 440Hz)
/*
Scale A A# B C C# D D# E F F# G G#
4 440 466 494 523 554 587 622 659 698 740 784 831
*/
//16
mySerial.write(212); // 1/4 note
mySerial.write(220); // A tone
//17
mySerial.write(212); // 1/4 note
mySerial.write(228); // F tone
//18
mySerial.write(212); // 1/4 note
mySerial.write(227); // E tone
//19
mySerial.write(212); // 1/4 note
mySerial.write(225); // D tone
//20
mySerial.write(211); // 1/8 note (this should be 3/18, but I don't know the “set length” command for it)
mySerial.write(222); // B tone
//21
mySerial.write(210); // 1/16 note
mySerial.write(222); // B tone
//22
mySerial.write(212); // 1/4 note
mySerial.write(220); // A tone
//23
mySerial.write(212); // 1/4 note
mySerial.write(228); // F tone
//24
mySerial.write(212); // 1/4 note
mySerial.write(230); // G tone
//25
mySerial.write(213); // 1/2 note (this should be 3/4, but I don't know the “set length” command for it)
mySerial.write(228); // F tone
delay(3000); // Wait 3 seconds
mySerial.write(18); // Turn backlight off
}
void loop() {
}