Please help. Pro Micro DEV-12587 and i2c problem

Hello everyone, first post here. I am very new to all of this. I have a pro micro hooked up to an RFM69HCW radio module. I also am wanting to run the MP3 QWICC trigger off pro micro. I currently have the pro micro and the radio module working properly, my problem is with the mp3 trigger. The problem is that the RFM69HCW needs the #3 pin on the pro micro for the INT0. The #3 pin is also the SCL for the i2c for the mp3 trigger… so can i have wire from the radio module AND the mp3 trigger going to pin 3?

I currently have it set up like this and can not get any of the example codes for the mp3 trigger to do anything. The mp3 player does work when i use the trigger pins. I’m stuck and need some direction. Thanks.

You likely just need to change the pin(s) the i2c bus is assigned to; share the code that you’re using that works and maybe we can point out how to re-assign the pin #'s

TS-Russell:
You likely just need to change the pin(s) the i2c bus is assigned to; share the code that you’re using that works and maybe we can point out how to re-assign the pin #'s

Thank you very much for the reply.

The RXLED was used for debugging purposes. As the code is now the RXLED will not turn on, even when “P” is received. If I move the digital write above the mp3.pause() RXLED will turn on when “P” is received.

#include <SparkFun_Qwiic_MP3_Trigger_Arduino_Library.h>

#include <Wire.h>

#include <RFM69.h>

#include <SPI.h>

// Addresses for this node. CHANGE THESE FOR EACH NODE!

#define NETWORKID 0 // Must be the same for all nodes

#define MYNODEID 2 // My node ID

#define TONODEID 1 // Destination node ID

// RFM69 frequency:

#define FREQUENCY RF69_915MHZ

int RXLED = 17;

// Create a library objects

MP3TRIGGER mp3;

RFM69 radio;

void setup()

{

Serial1.begin(9600);

// Initialize the RFM69HCW:

radio.setCS(10);

radio.initialize(FREQUENCY, MYNODEID, NETWORKID);

radio.setHighPower();

//For MP3

Serial.begin(115200);

Wire.begin();

pinMode(RXLED, OUTPUT);

void loop()

{

if (radio.receiveDone())

{

if (Serial1.readString() == ‘P’)

{

mp3.pause();

digitalWrite(RXLED, LOW);

}

if (Serial1.readString() == ‘N’)

{

mp3.playNext();

}

if (Serial1.readString() == “V0”)

{

mp3.setVolume(0);

}

if (Serial1.readString() == “V4”)

{

mp3.setVolume(4);

}

if (Serial1.readString() == “V8”)

{

mp3.setVolume(8);

}

if (Serial1.readString() == “V12”)

{

mp3.setVolume(12);

}

if (Serial1.readString() == “V16”)

{

mp3.setVolume(16);

}

if (Serial1.readString() == “V20”)

{

mp3.setVolume(20);

}

if (Serial1.readString() == “V24”)

{

mp3.setVolume(24);

}

if (Serial1.readString() == “V28”)

{

mp3.setVolume(28);

}

if (Serial1.readString() == “V32”)

{

mp3.setVolume(32);

}

}

}

TS-Russell:
You likely just need to change the pin(s) the i2c bus is assigned to; share the code that you’re using that works and maybe we can point out how to re-assign the pin #'s

Also, instead of changing the pins the i2c bus is assigned to, is there any way of changing what pin INT0 is on? That away I could use the i2c pins as they were designed and just change interrupt pin for the radio module on the pro micro.

TS-Russell:
You likely just need to change the pin(s) the i2c bus is assigned to; share the code that you’re using that works and maybe we can point out how to re-assign the pin #'s

Hello? I shared the code as you asked and no response.

I bought another pro micro with the qwiic connector. I thought this would solve my issue as the rfm69 could use the 3 pin on the board for INT0 and the mp3 could just use the qwiic connector on the pro micro. Both will work independently but not together. If the rfm69 is connected to INT0 the radio works but the mp3 will not. If INT0 is disconnected from the rfm69 the mp3 will work but not the radio. I’m stuck.

I do not have any of the hardware you refer to, but looking at the source code of the rfm69 library (RFM69.h) it looks an easy change.

In the top of the sketch define the pins to use. I changed the S_RF69_IRQ_PIN from pin 3 to pin 4 (so connect the RFM69 INT pin there). You can select another if you want.

Then it is passing on that information when you create the radio constructor.

Untested. !

Good Luck

#include <SparkFun_Qwiic_MP3_Trigger_Arduino_Library.h>
#include <Wire.h>
#include <RFM69.h>
#include <SPI.h>

// Addresses for this node. CHANGE THESE FOR EACH NODE!
#define NETWORKID 0 // Must be the same for all nodes
#define MYNODEID 2 // My node ID
#define TONODEID 1 // Destination node ID

// RFM69 frequency:
#define FREQUENCY RF69_915MHZ

int RXLED = 17;

// define the pins to use for the RFM69HCW radio module
#define S_RF69_SPI_CS     SS // SS is the SPI slave select pin
#define S_RF69_IRQ_PIN    4  // this used to be pin 3 but you can select another
#define S_RF69_IRQ_NUM    0  // default as INT0. Do not change.

// Create a library objects
MP3TRIGGER mp3;

// the false in the setting below seems to indicate that is an RFM69W and not an RFM69HW. The default was false.
RFM69(S_RF69_SPI_CS, S_RF69_IRQ_PIN, false, S_RF69_IRQ_NUM)  radio;

void setup()
{
  Serial1.begin(9600);
  
  // Initialize the RFM69HCW:
  radio.setCS(10);
  radio.initialize(FREQUENCY, MYNODEID, NETWORKID);
  radio.setHighPower();
  
  //For MP3
  Serial.begin(115200);
  Wire.begin();
  
  pinMode(RXLED, OUTPUT);     // is this set HIGH somewhere ?? or only LOW
}

void loop()
{
  if (radio.receiveDone())
  {
    if (Serial1.readString() == 'P')
    {
      mp3.pause();
      digitalWrite(RXLED, LOW);
    }
    if (Serial1.readString() == 'N')
    {
      mp3.playNext();
    }
    
    if (Serial1.readString() == "V0")
    {
      mp3.setVolume(0);
    }
    
    if (Serial1.readString() == "V4")
    {
      mp3.setVolume(4);
    }
    
    if (Serial1.readString() == "V8")
    {
      mp3.setVolume(8);
    }
    
    if (Serial1.readString() == "V12")
    {
      mp3.setVolume(12);
    }
    
    if (Serial1.readString() == "V16")
    {
      mp3.setVolume(16);
    }
    
    if (Serial1.readString() == "V20")
    {
      mp3.setVolume(20);
    }
    
    if (Serial1.readString() == "V24")
    {
      mp3.setVolume(24);
    }
    
    if (Serial1.readString() == "V28")
    {
      mp3.setVolume(28);
    }
    
    if (Serial1.readString() == "V32")
    {
      mp3.setVolume(32);
    }

  }
}

I’ll give this a try. Thanks!

paulvha:
I do not have any of the hardware you refer to, but looking at the source code of the rfm69 library (RFM69.h) it looks an easy change.

In the top of the sketch define the pins to use. I changed the S_RF69_IRQ_PIN from pin 3 to pin 4 (so connect the RFM69 INT pin there). You can select another if you want.

Then it is passing on that information when you create the radio constructor.

Untested. !

Good Luck

#include <SparkFun_Qwiic_MP3_Trigger_Arduino_Library.h>

#include <Wire.h>
#include <RFM69.h>
#include <SPI.h>

// Addresses for this node. CHANGE THESE FOR EACH NODE!
#define NETWORKID 0 // Must be the same for all nodes
#define MYNODEID 2 // My node ID
#define TONODEID 1 // Destination node ID

// RFM69 frequency:
#define FREQUENCY RF69_915MHZ

int RXLED = 17;

// define the pins to use for the RFM69HCW radio module
#define S_RF69_SPI_CS SS // SS is the SPI slave select pin
#define S_RF69_IRQ_PIN 4 // this used to be pin 3 but you can select another
#define S_RF69_IRQ_NUM 0 // default as INT0. Do not change.

// Create a library objects
MP3TRIGGER mp3;

// the false in the setting below seems to indicate that is an RFM69W and not an RFM69HW. The default was false.
RFM69(S_RF69_SPI_CS, S_RF69_IRQ_PIN, false, S_RF69_IRQ_NUM) radio;

void setup()
{
Serial1.begin(9600);

// Initialize the RFM69HCW:
radio.setCS(10);
radio.initialize(FREQUENCY, MYNODEID, NETWORKID);
radio.setHighPower();

//For MP3
Serial.begin(115200);
Wire.begin();

pinMode(RXLED, OUTPUT); // is this set HIGH somewhere ?? or only LOW
}

void loop()
{
if (radio.receiveDone())
{
if (Serial1.readString() == ‘P’)
{
mp3.pause();
digitalWrite(RXLED, LOW);
}
if (Serial1.readString() == ‘N’)
{
mp3.playNext();
}

if (Serial1.readString() == "V0")
{
  mp3.setVolume(0);
}

if (Serial1.readString() == "V4")
{
  mp3.setVolume(4);
}

if (Serial1.readString() == "V8")
{
  mp3.setVolume(8);
}

if (Serial1.readString() == "V12")
{
  mp3.setVolume(12);
}

if (Serial1.readString() == "V16")
{
  mp3.setVolume(16);
}

if (Serial1.readString() == "V20")
{
  mp3.setVolume(20);
}

if (Serial1.readString() == "V24")
{
  mp3.setVolume(24);
}

if (Serial1.readString() == "V28")
{
  mp3.setVolume(28);
}

if (Serial1.readString() == "V32")
{
  mp3.setVolume(32);
}

}
}

This code will not compile. I get an error on this line:

RFM69(S_RF69_SPI_CS, S_RF69_IRQ_PIN, false, S_RF69_IRQ_NUM) radio;

error is: expected ‘)’ before ‘,’ token

Maybe you have another RFM69 library. Can you share a link to the library you have ?

paulvha:
Maybe you have another RFM69 library. Can you share a link to the library you have ?

https://github.com/sparkfun/RFM69HCW_Br … master.zip

It is the link on sparkfuns hookup guide. I think it hasn’t been updated. I am guessing you were using the latest version?

Should have done the correct way for the constructor

#include <SparkFun_Qwiic_MP3_Trigger_Arduino_Library.h>
#include <Wire.h>
#include <RFM69.h>
#include <SPI.h>

// Addresses for this node. CHANGE THESE FOR EACH NODE!
#define NETWORKID 0 // Must be the same for all nodes
#define MYNODEID 2 // My node ID
#define TONODEID 1 // Destination node ID

// RFM69 frequency:
#define FREQUENCY RF69_915MHZ

int RXLED = 17;

// define the pins to use for the RFM69HCW radio module
#define S_RF69_SPI_CS     SS // SS is the SPI slave select pin
#define S_RF69_IRQ_PIN    4  // this used to be pin 3 but you can select another
#define S_RF69_IRQ_NUM    0  // default as INT0. Do not change.

// Create a library objects
MP3TRIGGER mp3;

// the false in the setting below seems to indicate that is an RFM69W and not an RFM69HW. The default was false.
RFM69 radio(S_RF69_SPI_CS, S_RF69_IRQ_PIN, false, S_RF69_IRQ_NUM);

void setup()
{
  Serial1.begin(9600);
  
  // Initialize the RFM69HCW:
  radio.setCS(10);
  radio.initialize(FREQUENCY, MYNODEID, NETWORKID);
  radio.setHighPower();
  
  //For MP3
  Serial.begin(115200);
  Wire.begin();
  
  pinMode(RXLED, OUTPUT);     // is this set HIGH somewhere ?? or only LOW
}

void loop()
{
  if (radio.receiveDone())
  {
    if (Serial1.readString() == 'P')
    {
      mp3.pause();
      digitalWrite(RXLED, LOW);
    }
    if (Serial1.readString() == 'N')
    {
      mp3.playNext();
    }
    
    if (Serial1.readString() == "V0")
    {
      mp3.setVolume(0);
    }
    
    if (Serial1.readString() == "V4")
    {
      mp3.setVolume(4);
    }
    
    if (Serial1.readString() == "V8")
    {
      mp3.setVolume(8);
    }
    
    if (Serial1.readString() == "V12")
    {
      mp3.setVolume(12);
    }
    
    if (Serial1.readString() == "V16")
    {
      mp3.setVolume(16);
    }
    
    if (Serial1.readString() == "V20")
    {
      mp3.setVolume(20);
    }
    
    if (Serial1.readString() == "V24")
    {
      mp3.setVolume(24);
    }
    
    if (Serial1.readString() == "V28")
    {
      mp3.setVolume(28);
    }
    
    if (Serial1.readString() == "V32")
    {
      mp3.setVolume(32);
    }

  }
}

Thanks Paul for the reply and correction. The code complied and uploaded successfully. But the radio still only works when connected to pin 3. No matter what I change S_RF69_IRQ_PIN to.

HI

You are correct. After looking deeper in the source code I see that the pin is not really used. It is using the INT0, which is pin 3:

attachInterrupt(_interruptNum, RFM69::isr0, RISING);

Now…

INT1 = D2 = SDA (you can not use this)

INT2 = D0 = RXI

INT3 = D1 = TX0

So you can try to set S_RF69_IRQ_NUM in the sketch to 2 and connect to RXi (D0) or set to 3 and connect to TX0 (D1)

Share back what happens .