Toll-Free Customer Support 24/7

Xbee Development Board with Voltage Regulator and Level Converter Compatible for Arduino (With XBEE)

/*
* Project name:
Xbee Development Board with Voltage Regulator and Level Converter Compatible for Arduino (With XBEE)
* Copyright
(c) Researchdesignlab.com
* Description:

* Test configuration:
MCU: ATMEGA328
Dev.Board: Arduino uno
Oscillator: 16 MHz
Software: Arduino

*/
/*

/*
Analog input, analog output, serial output


*/

/*
Software serial multple serial test

Receives from the hardware serial, sends to software serial.
Receives from software serial, sends to hardware serial.

The circuit:
* RX is digital pin 2 (connect to TX of other device)
* TX is digital pin 3 (connect to RX of other device)


This example code is in the public domain.

*/
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TXconst int analogInPin = A0; // Analog input pin that the potentiometer is attached to

const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
int sensorValue = 0;


void setup()
{
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
delay(500);
}

void loop() // run over and over
{

// read the analog in value:
sensorValue = analogRead(analogInPin);

// print the results to the serial monitor:
mySerial.print("sensor = " );
mySerial.println(sensorValue);

delay(1000);

}

 

Back to top