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.
Diff: main.cpp
- Revision:
- 0:2a72f8a7d7ee
- Child:
- 1:254373c96125
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Jul 18 02:25:16 2013 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+
+Serial speakJet(PTC4, PTC3); // tx, rx
+
+unsigned int message[] = {
+ /* hello */ 183, 007, 159, 146, 164, 6, 6,
+ /* my */ 140, 155, 6,
+ /* name */ 141, 154, 140, 6,
+ /* is */ 8, 129, 167, 6,
+ /* freescale*/ 8, 186, 148, 8, 128, 175, 8, 138, 6, 15, 140, 6,
+ /* freedom */ 8, 186, 148, 8, 128, 187, 195, 154, 145, 6
+};
+
+int i, messageSize = 40; // sizeof() function is NOT accurate!
+// messageSize = sizeof(message);
+
+int main()
+{
+ speakJet.baud(9600);
+
+ // Send the SpeakJet some initialisation values
+ speakJet.printf("%c", 20); // Enter volume set mode
+ speakJet.printf("%c", 96); // Set volume to 96 (out of 127)
+ speakJet.printf("%c", 21); // Enter speed set mode
+ speakJet.printf("%c", 114); // Set speed to 114 (out of 127)
+ wait(1);
+ while(1) {
+ for (i=0; i<messageSize; i++) {
+ speakJet.printf("%c", message[i]);
+ }
+ wait(10);
+ }
+}
\ No newline at end of file