Go Down

Topic: Virtual Wire attiny85 (Read 1 time) previous topic - next topic

mfrere

Hi there !

I have looked and looked again and again everywhere on internet about my problem.
Here it is : I have an arduino Uno with a RF 433MHz transmitter and an attiny85 with a RF 433MHz reciever.
For now, I am triyng to blink a LED with the attiny but that doesn't work ... When I use an arduino Uno instead of an attiny, that is working ...

Does anyone have any idea to help me pleeeaasse ?

Thank you very much
Here is the different codes

Transmitter
Code: [Select]

#include <VirtualWire.h>
const char* CMD_BUTTON_A = "BPA";

void setup() {
  vw_setup(1000);
}
 
void loop() {
  byte message[VW_MAX_MESSAGE_LEN];
  vw_send((byte*) CMD_BUTTON_A, strlen(CMD_BUTTON_A) + 1); // On envoie le message
  vw_wait_tx(); // On attend la fin de l'envoi
  delay(2000);
}


Reciever

Code: [Select]

/*Importations des bibliotèques*/
#include <VirtualWire.h>

/* Différents messages de commande */
const char* CMD_BUTTON_A = "BPA";

void setup() {
  pinMode(1, OUTPUT);
  vw_set_rx_pin(3);
  vw_rx_start(); // On peut maintenant recevoir des messages
  vw_setup(1000);
}

void loop() {
  byte message[VW_MAX_MESSAGE_LEN];
  byte taille_message = VW_MAX_MESSAGE_LEN;

  vw_wait_rx();
 
  if (vw_get_message(message, &taille_message)) {
    if (strcmp((char*) message, CMD_BUTTON_A) == 0) {   
      digitalWrite(3, HIGH);   
      delay(5000);                       
      digitalWrite(3, LOW);   
      delay(1000);
    } 
  }
}

DrAzzy

Is this a naked t85 ir a digispark clone?

If a naked t85, have you done "burn bootloader" to set the clock speed? Upload blink and make sure it blinks at the right speed.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Carlmikael

#2
Dec 09, 2019, 06:27 am Last Edit: Dec 09, 2019, 10:04 am by Carlmikael
Why do use the same pin for RX and output to a blink pin 3. You have set pin 1 to output. Change the blink to pin 1. I don´t think there is a good idea to set RX pin High and Low.

 /Mikael

Go Up