Christian
02-06-2007, 11:54 AM
I need some wireless help. I have been working on this for a month and I'm stumped. Please help! What am I doing wrong? Here is the setup and code.
BASIC Stamp side:
I have a BS2 BOE Kit with a 433MHz RF transmiter (data on PIN 8) and a 433MHZ RF receiver (data on pin 7). The BS2 is connected to the PC using the serial port COM1 for debugging. Here is my BS2 Code:
'{$STAMP BS2}
'{$PBASIC 2.5}
'{$PORT COM1}
x VAR Byte(8)
Main:
DO
· PULSOUT 7, 1200
· SERIN 7/8, 396, [WAIT("!"), STR x\8]
· DEBUG STR x
· SEROUT 8/7, 396, ["Received",x]
LOOP
PC Side:
I then have a USB2SER with TX connected to another 433MHz RF transmiter, RX connected to a 433MHz RF reciever, and VSS connected to GND on both transmitter and receiver. RES is not connected. I am powering the 5V on all transmitters from the BS2 VDD pin with GND connected to the BS2 VSS pin.
I am using the USB2SER to connect a PC to the wireless transmitters and send information. Here is the PC code in C#, where I am using COM6 for the USB2SER:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace USB2SER_Comm
{
public partial class Form1 : Form
{
string port = "";
public Form1()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
port=comboBox1.Text;
if (!serialPort1.IsOpen)
{
serialPort1.PortName = port;
serialPort1.BaudRate = 2400;
serialPort1.DataBits = 8;
serialPort1.Parity = 0;
serialPort1.Open();
}
}
private void Form1_Load(object sender, EventArgs e)
{
string[] pts = System.IO.Ports.SerialPort.GetPortNames();
foreach (string pt in pts)
{
comboBox1.Items.Add(pt.ToString());
}
}
private void button4_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
serialPort1.Close();
}
}
private void button1_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
serialPort1.Write(textBox1.Text);
}
}
private void button2_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
textBox2.Text = serialPort1.ReadExisting().ToString();
}
}
}
}
·
BASIC Stamp side:
I have a BS2 BOE Kit with a 433MHz RF transmiter (data on PIN 8) and a 433MHZ RF receiver (data on pin 7). The BS2 is connected to the PC using the serial port COM1 for debugging. Here is my BS2 Code:
'{$STAMP BS2}
'{$PBASIC 2.5}
'{$PORT COM1}
x VAR Byte(8)
Main:
DO
· PULSOUT 7, 1200
· SERIN 7/8, 396, [WAIT("!"), STR x\8]
· DEBUG STR x
· SEROUT 8/7, 396, ["Received",x]
LOOP
PC Side:
I then have a USB2SER with TX connected to another 433MHz RF transmiter, RX connected to a 433MHz RF reciever, and VSS connected to GND on both transmitter and receiver. RES is not connected. I am powering the 5V on all transmitters from the BS2 VDD pin with GND connected to the BS2 VSS pin.
I am using the USB2SER to connect a PC to the wireless transmitters and send information. Here is the PC code in C#, where I am using COM6 for the USB2SER:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace USB2SER_Comm
{
public partial class Form1 : Form
{
string port = "";
public Form1()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
port=comboBox1.Text;
if (!serialPort1.IsOpen)
{
serialPort1.PortName = port;
serialPort1.BaudRate = 2400;
serialPort1.DataBits = 8;
serialPort1.Parity = 0;
serialPort1.Open();
}
}
private void Form1_Load(object sender, EventArgs e)
{
string[] pts = System.IO.Ports.SerialPort.GetPortNames();
foreach (string pt in pts)
{
comboBox1.Items.Add(pt.ToString());
}
}
private void button4_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
serialPort1.Close();
}
}
private void button1_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
serialPort1.Write(textBox1.Text);
}
}
private void button2_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
textBox2.Text = serialPort1.ReadExisting().ToString();
}
}
}
}
·