I am French sorry for this translation
Hello I have a problem with a transmitter 433Mhz,
I have a transmitter 433 Mhz, it transmits a code 7649BD4, how to proceed to the reception so that arduino decodes this hexadecimal code,
Can you help me please.
For help, please read and follow the directions in the "How to use this forum" post.
I know how to use the forum but the French can not know my problem
NO, you do not know how to use the forum . Read the post and follow the directions .
But I ask for help in the English category, what's wrong?
i don't understand
So, can you help me please?
Summary of the instructions in the "How to use this forum" post:
Post the code, using code tags
Post links to the modules you are using
Describe what the program should do, and what it does instead
If necessary, post a wiring diagram (not a Fritzing idiot diagram)
#include <VirtualWire.h>
void setup() {
vw_setup(2000);
vw_set_rx_pin(2);
vw_rx_start();
Serial.begin(9600);
Serial.println("Begun !");
}
void loop() {
uint8_t buflen = VW_MAX_MESSAGE_LEN;
uint8_t buf[buflen];
if(vw_get_message(buf, &buflen)) {
Serial.println("test");
}
}
My receiver : http://www.instructables.com/id/RF-315433-MHz-Transmitter-receiver-Module-and-Ardu/
The program does not display anything, I want the arduino program to display the haxadecimal code of the receiver.
In RadioHead, you do this:
driver.printBuffer("Got:", buf, buflen);
If Virtual Wire doesn't implement that function, just switch to RadioHead.
Apex142
October 23, 2017, 10:19pm
10
how use driver.printBuffer("Got:", buf, buflen); ??
Apex142:
how use driver.printBuffer("Got:", buf, buflen); ??
Put your eyes in front of the serial monitor and read the results.
Apex142
October 23, 2017, 10:30pm
12
No working,
#include <VirtualWire.h>
void setup() {
vw_setup(2000);
vw_set_rx_pin(2);
vw_rx_start();
Serial.begin(9600);
Serial.println("Begun !");
}
void loop() {
uint8_t buflen = VW_MAX_MESSAGE_LEN;
uint8_t buf[buflen];
driver.printBuffer("Got:", buf, buflen);
}
Error : 'driver' was not declared in this scope
system
October 23, 2017, 10:52pm
13
No working,
Of course it isn't. Re-read reply # 8, paying attention this time.
Apex142
October 23, 2017, 10:54pm
14
sorry but i dont understand RadioHead
system
October 23, 2017, 10:57pm
15
The VirtualWire library is obsolete. The replacement is the RadioHead library. Forget that VirtualWire, and the examples that come with it exist.
Download and install the RadioHead library, and use the examples that come with it as the starting point for YOUR code.
Then, you can use the method that was suggested without the compiler pitching a fit.
Virtual Wire also has what you are asking for.
// receiver.pde
//
// Simple example of how to use VirtualWire to receive messages
// Implements a simplex (one-way) receiver with an Rx-B1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@open.com.au)
// Copyright (C) 2008 Mike McCauley
// $Id: receiver.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $
#include <VirtualWire.h>
void setup()
{
Serial.begin(9600); // Debugging only
Serial.println("setup");
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for DR3100
vw_setup(2000); // Bits per sec
This file has been truncated. show original
Apex142
October 23, 2017, 11:09pm
17
aarg no, working,
#include <VirtualWire.h>
void setup()
{
Serial.begin(9600); // Debugging only
Serial.println("setup");
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for DR3100
vw_set_rx_pin(2);
vw_setup(2000); // Bits per sec
vw_rx_start(); // Start the receiver PLL running
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // Non-blocking
{
int i;
digitalWrite(13, true); // Flash a light to show received good message
// Message with a good checksum received, dump it.
Serial.print("Got: ");
for (i = 0; i < buflen; i++)
{
Serial.print(buf[i], HEX);
Serial.print(" ");
}
Serial.println("");
digitalWrite(13, false);
}
}
Post a clear photograph of your hardware.
Apex142
October 23, 2017, 11:36pm
19
Receive :
Data -> D2
VCC -> 5V
GRND -> GRND
Apex142
October 24, 2017, 9:50am
20
Can you help me, please ?