User Tools

Site Tools


serial_communications_sketches
software_loobback.pde
/*
 Software Serial Loopback (work with USB serial too)
 This example code is in the public domain. 
 */
//Serial USB
//Serial0 Uart1 shared by all Kard Slots except Serial 
//Serial1 rs232 rail c
//Serial2 422 H-bus
//Serial3 422 rail c
void setup() 
{ 
  Serial.begin(115200); 
} 
 
void loop() 
{
  int data = 0;   // for incoming serial data
  if (Serial.available() > 0) {
    data = Serial.read();  // read the incoming byte:
    Serial.write(data);    // Send it back from where it came
  }
} 
serial_communications_sketches.txt · Last modified: 2014/04/09 01:09 by mike