Changes between Version 15 and Version 16 of ARMS22-SOFTMODEM-HOWTO


Ignore:
Timestamp:
Mar 18, 2011 10:59:19 AM (9 years ago)
Author:
Ken Suzuki
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ARMS22-SOFTMODEM-HOWTO

    v15 v16  
    5353
    5454=== Sample Sketch ===
     55
     56{{{
     57#!C
     58# Include <SoftModem.h>
     59# Include <ctype.h>
     60
     61SoftModem modem;
     62
     63void setup ()
     64{
     65 Serial.begin (57600);
     66 delay (1000);
     67 modem.begin ();
     68}
     69
     70void loop ()
     71{
     72 while (modem.available ()) {
     73   int c = modem.read ();
     74   if (isprint (c)) {
     75     Serial.println ((char) c);
     76   }
     77   else {
     78     Serial.print ("(");
     79     Serial.print (c, HEX);
     80     Serial.println (")");     
     81   }
     82 }
     83 if (Serial.available ()) {
     84   modem.write (0xff);
     85   while (Serial.available ()) {
     86     char c = Serial.read ();
     87     modem.write (c);
     88   }
     89 }
     90}
     91}}}