groworld/xylem/xylem_wireless_recv/xylem_wireless_recv.pde

30 lines
506 B
Text
Raw Normal View History

2009-08-13 17:03:19 +00:00
///////////// part of the groworld HPI prototype
///////////// serial -> wireless setup
#include <SoftwareSerial.h>
#define rxPin 0
#define txPin 1
// set up a new serial port
SoftwareSerial wireless = SoftwareSerial(rxPin, txPin);
void setup()
{
// wireless serial
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
wireless.begin(4800);
// wired serial output
Serial.begin(9600);
}
void loop()
{
// read, then write
char someChar = wireless.read();
Serial.print(someChar);
}