hello all.... I am confused a bit.I have wrote the vb code to make ON and OFF the LED connected to arduino. I am sending data from VB app over COM port (instead of serial monitor) and the data is '1' for LED ON and '0' for OFF. Here I want to send this signal thru RF-433 module. I have connected the TX pin of arduino to Data pin of RF module. On other hand, second arduino is connected to RF Receiver with LED on Pin 12. Now I am not getting how to write code for arduino of Tx side to send data thru RF...??? I want to send data which is coming from VB serial port, and send it by arduino's Tx pin to which the RF module is connected.
Here is my vb code:
Imports System.IO Imports System.IO.Ports Imports System.Threading
Public Class Form1
Shared _continue As Boolean Shared _serialPort As SerialPort
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load SerialPort1.Close() SerialPort1.PortName = "com12" 'change com port to match your Arduino port SerialPort1.BaudRate = 9600 SerialPort1.DataBits = 8 SerialPort1.Parity = Parity.None SerialPort1.StopBits = StopBits.One SerialPort1.Handshake = Handshake.None SerialPort1.Encoding = System.Text.Encoding.Default 'very important! End Sub
Private Sub btnOn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOn.Click picOn.Visible = True SerialPort1.Open() SerialPort1.Write("1") SerialPort1.Close() End Sub
Private Sub btnOff_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOff.Click picOn.Visible = False SerialPort1.Open() SerialPort1.Write("0") SerialPort1.Close() End Sub End Class
NOTE: THE ABOVE VB CODE IS WORKING WELL.
So please guide me to write code for Transmitting the data thru RF module.