Virtualwire

Páginas: 9 (2126 palabras) Publicado: 9 de agosto de 2012
May 7, 2012

VirtualWire
Copyright (C) 2008-2011
Mike McCauley

Documentation for the VirtualWire 1.9
communications library for Arduino.

1.0 Introduction
Arduino is a low cost microcontroller with Open Source hardware, see http://www.arduino.cc. VirtualWire is a communications library for Arduino that allows multiple Arduino’s to communicate using low-cost RF transmitters andreceivers.
The document describes the VirtualWire library and how to install and use it.
You can also find online help and disussion at
http://groups.google.com/group/virtualwire

2.0 Overview
VirtualWire is an Arduino library that provides features to send short messages, without
addressing, retransmit or acknowledgment, a bit like UDP over wireless, using ASK
(amplitude shift keying). Supports anumber of inexpensive radio transmitters and
receivers. All that is required is transmit data, receive data and (for transmitters, optionally) a PTT transmitter enable.
It is intended to be compatible with the RF Monolithics (www.rfm.com) Virtual Wire
protocol, but this has not been tested.
Does not use the Arduino UART. Messages are sent with a training preamble, message
length and checksum.Messages are sent with 4-to-6 bit encoding for good DC balance,
and a CRC checksum for message integrity.

1 of 13

Overview

Why not just use the Arduino UART connected directly to the transmitter/receiver? As
discussed in the RFM documentation, ASK receivers require a burst of training pulses
to synchronize the transmitter and receiver, and also requires good balance between 0s
and1s in the message stream in order to maintain the DC balance of the message.
UARTs do not provide these. They work a bit with ASK wireless, but not as well as this
code.
2.1 Supported hardware.
A range of communications hardware is supported. The ones listed blow are available in
common retail outlets in Australian and other countries for under $10 per unit. Many
other modules may also workwith this software.
Runs on ATmega8/168 (Arduino Diecimila etc) and ATmega328 and possibly others.
2.2

Receivers

• RX-B1 (433.92MHz) (also known as ST-RX04-ASK)

FIGURE 1.

RX-B1

Details at http://www.summitek.com.tw/ST_SPEC/ST-RX04-ASK.pdf
2.3

Transmitters:

• TX-C1 (433.92MHz)

2 of 13

VirtualWire

Overview

FIGURE 2.

TX-C1

Details athttp://www.tato.ind.br/files/TX-C1.pdf
2.4

Transceivers:

• DR3100 (433.92MHz)

VirtualWire

3 of 13

Downloading and installation

FIGURE 3.

DR3100

Details at http://www.rfmonolithics.com/products/data/dr3100.pdf

3.0 Downloading and installation
The latest version of this document is available from
http://www.open.com.au/mikem/arduino/VirtualWire.pdf

Download the VirtualWire distribution fromhttp://www.open.com.au/mikem/arduino/VirtualWire-1.9.zip

To install, unzip the library into the libraries sub-directory of your Arduino application directory. Then launch the Arduino environment; you should see the library in the
Sketch->Import Library menu, and example code in
File->Sketchbook->Examples->VirtualWire menu.

4.0 Function calls
To use the VirtualWire library, you must have#include

At the top of your sketch.

4 of 13

VirtualWire

Function calls

4.1 vw_set_tx_pin
extern void vw_set_tx_pin(uint8_t pin);

Set the digital IO pin to use for transmit data. Defaults to 12.
4.2 vw_set_rx_pin
extern void vw_set_rx_pin(uint8_t pin);

Set the digital IO pin to use for receive data. Defaults to 11.
4.3 vw_set_ptt_pin
extern void vw_set_ptt_pin(uint8_tpin);

Set the digital IO pin to use to enable the transmitter (press to talk). Defaults to 10. Not
all transmitters require PTT. The DR3100 does, but the TX-B1 does not.
4.4 vw_set_ptt_inverted
extern void vw_set_ptt_inverted(uint8_t inverted);

By default the PTT pin goes high when the transmitter is enabled. This flag forces it low
when the transmitter is enabled. Required for the...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Libreria Virtualwire Arduino

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS