Home‎ > ‎DroidBuilders Blog‎ > ‎

Using Arduino 1.0 requires minor updates in your SpeakJet code...

posted Jul 9, 2012, 1:32 PM by Galen Raben   [ updated Jul 9, 2012, 1:32 PM ]
7/9/2012
Some minor modifications to your code is required if you've recently updated to Arduino 1.o. I've made some of these changes in my Advanced TTS Programming tutorial but I know it is hiding in the Basic tutorials as well. I'll get it fixed there whenever I have a few minutes  to spare.

If you've seen something like the the following screen in Arduino 1.0 or 1.0.1 (as of this writing)


then you have seen the error I am talking about.  Fortunately the fix is pretty easy!

What to look for: The changes in Arduino 1.0 that affect the SpeakJet Shield occur wherever I/you have used the "print" function and the "BYTE" keyword to send MSA codes to the SpeakJet chip. For example if you have any code that looks  like this:

  speakJet.print(13, BYTE); // send cr          
  speakJet.print(20, BYTE); // sj volume        
  speakJet.print(96, BYTE); // 0-127 default 96 
  speakJet.print(21, BYTE); // sj speed         
  speakJet.print(120, BYTE);// 0-127 default 114


needs to be changed to:

  speakJet.write(13); // send cr          
  speakJet.write(20); // sj volume        
  speakJet.write(96); // 0-127 default 96 
  speakJet.write(21); // sj speed         
  speakJet.
write(120);// 0-127 default 114

Simple huh?

Once this is done, your sketch should run in Arduino 1.0 just fine. Also note  as of Arduino 1.0 that the default sketch filename extension .pde has changed to .ino (however this does not upset Arduino 1.0 though - either will load fine).


Comments