Pages: [1]   Go Down
Author Topic: Communicating between the Arduino UNO and the Attiny85 using an RX link.  (Read 809 times)
0 Members and 1 Guest are viewing this topic.
Westbrook, CT
Offline Offline
Full Member
***
Karma: 2
Posts: 139
"Why should I bother with made-up games when there are so many real ones going on." (c) Kurt Vonnegut
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Guys, Recently I got a 434MHz RF link connection pair from Spark Fun. I ordered them because I wanted to develop a distant temperature reader that  sends the data to an Arduino UNO and the Arduino would log it.

https://www.sparkfun.com/products/10534 - RF Link Transmitter (434MHz)
https://www.sparkfun.com/products/10532 - RF Link Receiver (434MHz)

Before they arrived, I was writing some code using the Virtual Wire library but then I realized that the code wasn't compiling any more in the Arduino IDE v.1.4 but it did in earlier versions of Arduino such as the Arduino 0022 version. The latest version of the library was written back in 2010 so it's clearly outdated. There were other examples of how to use the transmitter and receiver through the Serial port between two Arduino's running at a baud rate of 2400bps. But unfortunately I don't have two Arduino UNO's.

As an alternative I would like to get some suggestions from you guys on how to write a simple code that would be compatible for Attiny85 (transmitter) hopefully communicable with the Arduino UNO (receiver). I was thinking of using the some Shiftout library that could be compatible with the Attiny85. If you know any sources or earlier posts similar to my subject please send it, I would be very happy!  smiley-draw


* DSC_9794.JPG (3608.48 KB, 3872x2592 - viewed 40 times.)
Logged

Arduino Uno R3
Mac OSX Lion


Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8096
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Often it is easy to change an older library to work on Arduino 1.x.  What is the first error message you get when you try to verify a sketch?  If it tells you that the "WProgram.h" file wasn't found, change the library sources to use "Arduino.h" instead.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Westbrook, CT
Offline Offline
Full Member
***
Karma: 2
Posts: 139
"Why should I bother with made-up games when there are so many real ones going on." (c) Kurt Vonnegut
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Often it is easy to change an older library to work on Arduino 1.x.  What is the first error message you get when you try to verify a sketch?  If it tells you that the "WProgram.h" file wasn't found, change the library sources to use "Arduino.h" instead.

So here is the full error report, I didn't find the "WProgram.h" part in it. However, can you explain or give a link on how to actually correct older libraries for the Arduino IDE 1.0 & up versions? Is it in the preferences text file?

Thanks for the reply. smiley

Code:
In file included from transmitter.pde:11:
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:59: error: variable or field 'vw_set_tx_pin' declared void
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:59: error: 'uint8_t' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:63: error: variable or field 'vw_set_rx_pin' declared void
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:63: error: 'uint8_t' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:67: error: variable or field 'vw_set_ptt_pin' declared void
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:67: error: 'uint8_t' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:71: error: variable or field 'vw_set_ptt_inverted' declared void
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:71: error: 'uint8_t' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:76: error: variable or field 'vw_setup' declared void
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:76: error: 'uint16_t' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:90: error: 'uint8_t' does not name a type
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:98: error: 'uint8_t' does not name a type
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:104: error: 'uint8_t' does not name a type
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:107: error: 'uint8_t' does not name a type
/Applications/Arduino.app/Contents/Resources/Java/libraries/VirtualWire/VirtualWire.h:112: error: 'uint8_t' does not name a type
transmitter.pde: In function 'void setup()':
transmitter:21: error: 'vw_set_tx_pin' was not declared in this scope
transmitter:22: error: 'vw_set_rx_pin' was not declared in this scope
transmitter:23: error: 'vw_set_ptt_pin' was not declared in this scope
transmitter:24: error: 'vw_set_ptt_inverted' was not declared in this scope
transmitter:25: error: 'vw_setup' was not declared in this scope
transmitter.pde: In function 'void loop()':
transmitter:36: error: 'vw_send' was not declared in this scope
« Last Edit: March 16, 2013, 10:59:39 pm by mixania » Logged

Arduino Uno R3
Mac OSX Lion


Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8096
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You should move your VirtualWire library to:

/Users/<username>/Documents/Arduino/libraries/VirtualWire

It's not safe to put third-party libraries inside the Arduino app. Those libraries will be lost if you update the Arduino software.

Looks like something is wrong with your copy of the VirtualWire library.  It looks like it is not including Arduino.h.  Do you have V1.4 (or higher) of VirtualWire?  That's the version I have and it appears to be Arduino 1.x compatible.  It looks like the latest version is 1.14!

http://www.open.com.au/mikem/arduino/VirtualWire/
http://www.open.com.au/mikem/arduino/VirtualWire/VirtualWire-1.14.zip
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Westbrook, CT
Offline Offline
Full Member
***
Karma: 2
Posts: 139
"Why should I bother with made-up games when there are so many real ones going on." (c) Kurt Vonnegut
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like something is wrong with your copy of the VirtualWire library.  It looks like it is not including Arduino.h.  Do you have V1.4 (or higher) of VirtualWire?  That's the version I have and it appears to be Arduino 1.x compatible.  It looks like the latest version is 1.14!

Wow!! Wasser! Thank you very much my friend! smiley-lol I've been searching and searching for the official resource of the Virtual Wire library and couldn't find it! smiley-sweat I guess I was way off thinking that te latest version is 1.4  smiley-yell I've done evrything you said and works better than ever!

What made me more happy is their release fore for the 1.14 version:

Quote
1.14 Added support ATtiny85 on Arduino, patch provided by r4z0r7o3.

Exactly what I need, support for my Attiny85.
Thanks for the help! Very much appreciated!
« Last Edit: March 17, 2013, 11:32:50 am by mixania » Logged

Arduino Uno R3
Mac OSX Lion


Pages: [1]   Go Up
Jump to: