Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 00003 Serial speakJet(PTA2, PTA1); // tx, rx 00004 00005 unsigned int message[] = { 00006 /* hello */ 183, 007, 159, 146, 164, 6, 6, 00007 /* my */ 140, 155, 6, 00008 /* name */ 141, 154, 140, 6, 00009 /* is */ 8, 129, 167, 6, 00010 /* freescale*/ 8, 186, 148, 8, 128, 187, 195, 154, 145, 6, 00011 /* freedom */ 8, 186, 148, 8, 128, 175, 8, 138, 6, 15, 140, 6 00012 }; 00013 00014 int i, messageSize = 40; // sizeof() function is NOT accurate! 00015 // messageSize = sizeof(message); 00016 00017 int main() 00018 { 00019 speakJet.baud(9600); 00020 00021 // Send the SpeakJet some initialisation values 00022 speakJet.printf("%c", 20); // Enter volume set mode 00023 speakJet.printf("%c", 96); // Set volume to 96 (out of 127) 00024 speakJet.printf("%c", 21); // Enter speed set mode 00025 speakJet.printf("%c", 114); // Set speed to 114 (out of 127) 00026 wait(1); 00027 while(1) { 00028 for (i=0; i<messageSize; i++) { 00029 speakJet.printf("%c", message[i]); 00030 } 00031 wait(10); 00032 } 00033 }
Generated on Tue Jul 19 2022 03:01:26 by
1.7.2