🔮Adafruit sale all weekend long – use the code ADATHX for 15% off! 🔮
0

Trinket Pro 5V and the RFM69HCW?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket Pro 5V and the RFM69HCW?

by geeky121 on Tue Sep 20, 2016 12:19 pm

I would like to know if the Trinket Pro 5v and the RFM69HCW boards are compatible in any way? I've searched around trying to find any information on it and I've come up empty handed. So now I'm wondering if this is even possible?

Thanks!

geeky121
 
Posts: 9
Joined: Tue Sep 20, 2016 12:18 pm

Re: Trinket Pro 5V and the RFM69HCW?

by franklin97355 on Tue Sep 20, 2016 4:19 pm

I don't see any reason they shouldn't work together.

franklin97355
 
Posts: 21647
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Trinket Pro 5V and the RFM69HCW?

by geeky121 on Tue Sep 20, 2016 5:46 pm

franklin97355 wrote:I don't see any reason they shouldn't work together.


Me either. But the RFM59HCW uses the SPI Library which is incompatible with the Trinket it looks like. I get errors that have to deal with the SPI class which the RFM69 library uses. Is there any way to get around this or possibly a different way to get around it?


Here is one of the errors:

Code: Select all | TOGGLE FULL SIZE
C:\Users\Geeky\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.12\libraries\SPI\src/SPI.h:250:27: error: 'SPIF' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                           ^

geeky121
 
Posts: 9
Joined: Tue Sep 20, 2016 12:18 pm

Re: Trinket Pro 5V and the RFM69HCW?

by franklin97355 on Tue Sep 20, 2016 6:37 pm

Are you using the Trinket or the Trinket Pro?

franklin97355
 
Posts: 21647
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Trinket Pro 5V and the RFM69HCW?

by geeky121 on Tue Sep 20, 2016 6:39 pm

franklin97355 wrote:Are you using the Trinket or the Trinket Pro?

The Trinket Pro 5v 16 MHz

geeky121
 
Posts: 9
Joined: Tue Sep 20, 2016 12:18 pm

Re: Trinket Pro 5V and the RFM69HCW?

by franklin97355 on Tue Sep 20, 2016 6:59 pm

What code are you trying to compile?

franklin97355
 
Posts: 21647
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Trinket Pro 5V and the RFM69HCW?

by geeky121 on Tue Sep 20, 2016 7:04 pm

franklin97355 wrote:What code are you trying to compile?


Code: Select all | TOGGLE FULL SIZE
/* RFM69 library and code by Felix Rusu - felix@lowpowerlab.com
// Get libraries at: https://github.com/LowPowerLab/
// Make sure you adjust the settings in the configuration section below !!!
// **********************************************************************************
// Copyright Felix Rusu, LowPowerLab.com
// Library and code by Felix Rusu - felix@lowpowerlab.com
// **********************************************************************************
// License
// **********************************************************************************
// This program is free software; you can redistribute it
// and/or modify it under the terms of the GNU General   
// Public License as published by the Free Software       
// Foundation; either version 3 of the License, or       
// (at your option) any later version.                   
//                                                                                   
//                                                       
// You should have received a copy of the GNU General   
// Public License along with this program.
// If not, see <http://www.gnu.org/licenses></http:>.
//                                                       
// Licence can be viewed at                               
// http://www.gnu.org/licenses/gpl-3.0.txt
//
// Please maintain this license information along with authorship
// and copyright notices in any redistribution of this code
// **********************************************************************************/
 
#include <RFM69.h>    //get it here: https://www.github.com/lowpowerlab/rfm69
 
//*********************************************************************************************
// *********** IMPORTANT SETTINGS - YOU MUST CHANGE/ONFIGURE TO FIT YOUR HARDWARE *************
//*********************************************************************************************
#define NETWORKID     100  //the same on all nodes that talk to each other
#define NODEID        1 
 
//Match frequency to the hardware version of the radio on your Feather
//#define FREQUENCY     RF69_433MHZ
//#define FREQUENCY     RF69_868MHZ
#define FREQUENCY      RF69_915MHZ
#define ENCRYPTKEY     "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HCW    true // set to 'true' if you are using an RFM69HCW module
 
//*********************************************************************************************
#define RFM69_CS      10
#define RFM69_IRQ     0
#define RFM69_IRQN    0  // Pin 2 is IRQ 0!
#define RFM69_RST     9
 
#define LED           13  // onboard blinky
 
int16_t packetnum = 0;  // packet counter, we increment per xmission
 
RFM69 radio = RFM69(RFM69_CS, RFM69_IRQ, IS_RFM69HCW, RFM69_IRQN);
 
void setup() { 
 
  // Hard Reset the RFM module
  pinMode(RFM69_RST, OUTPUT);
  digitalWrite(RFM69_RST, HIGH);
  delay(100);
  digitalWrite(RFM69_RST, LOW);
  delay(100);
 
  // Initialize radio
  radio.initialize(FREQUENCY,NODEID,NETWORKID);
  if (IS_RFM69HCW) {
    radio.setHighPower();    // Only for RFM69HCW & HW!
  }
  radio.setPowerLevel(31); // power output ranges from 0 (5dBm) to 31 (20dBm)
 
  radio.encrypt(ENCRYPTKEY);
 
  pinMode(LED, OUTPUT);
 
}
 
void loop() {
  //check if something was received (could be an interrupt from the radio)
  if (radio.receiveDone())
  {
    //print message received to serial
 
    //check if received message contains Hello World
    if (strstr((char *)radio.DATA, "Hello World"))
    {
      //check if sender wanted an ACK
      if (radio.ACKRequested())
      {
        radio.sendACK();
      }
      Blink(LED, 40, 3); //blink LED 3 times, 40ms between blinks
    } 
  }
 
  radio.receiveDone(); //put radio in RX mode
}
 
void Blink(byte PIN, byte DELAY_MS, byte loops)
{
  for (byte i=0; i<loops; i++)
  {
    digitalWrite(PIN,HIGH);
    delay(DELAY_MS);
    digitalWrite(PIN,LOW);
    delay(DELAY_MS);
  }
}

geeky121
 
Posts: 9
Joined: Tue Sep 20, 2016 12:18 pm

Re: Trinket Pro 5V and the RFM69HCW?

by franklin97355 on Tue Sep 20, 2016 7:13 pm

Other than a couple of warnings that code compiled fine using 1.6.9 and Pro Trinket 5v/16MHz (USB)

franklin97355
 
Posts: 21647
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Trinket Pro 5V and the RFM69HCW?

by geeky121 on Tue Sep 20, 2016 7:16 pm

franklin97355 wrote:Other than a couple of warnings that code compiled fine using 1.6.9 and Pro Trinket 5v/16MHz (USB)

Okay that's interesting. Lemme try again. What library are you using and from where did you get it?

geeky121
 
Posts: 9
Joined: Tue Sep 20, 2016 12:18 pm

Re: Trinket Pro 5V and the RFM69HCW?

by franklin97355 on Tue Sep 20, 2016 7:31 pm

Code: Select all | TOGGLE FULL SIZE
# RFM69 Library  [![Build Status](https://travis-ci.org/LowPowerLab/RFM69.svg)](https://travis-ci.org/LowPowerLab/RFM69)

By Felix Rusu, [LowPowerLab.com](http://LowPowerLab.com)
<br/>
RFM69 library for RFM69W, RFM69HW, RFM69CW, RFM69HCW (semtech SX1231, SX1231H)
<br/>
The latest examples, new features and bug fixes are found in the [original repository](https://github.com/LowPowerLab/RFM69) of this library.
not sure where I got it.

franklin97355
 
Posts: 21647
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Trinket Pro 5V and the RFM69HCW?

by geeky121 on Tue Sep 20, 2016 8:24 pm

Is there any way you could send me the your version of the library? I've tried on another computer with a fresh install of arduino ide 1.6.9 and I'm still getting the same error...

geeky121
 
Posts: 9
Joined: Tue Sep 20, 2016 12:18 pm

Re: Trinket Pro 5V and the RFM69HCW?

by geeky121 on Tue Sep 20, 2016 8:42 pm

I got it. I was selecting the wrong board when I tried it the second time. Thanks for your help!

geeky121
 
Posts: 9
Joined: Tue Sep 20, 2016 12:18 pm

Please be positive and constructive with your questions and comments.