MKR1000 IRRemote change timer

I have an Arduino MKR1000 that I would like to use with WIfi Client Wifi101 and IRRemote lib.
IRRemore works for a while then stops. I found out that it might be because of using the same timer as wifi client.
I found it is possible to change timers for IRRemote.
so I did:

#include <IRremote.h>

#define IR_SAMD_TIMER       TC4

#include <IRremote.hpp>
...

but it's all the same: board runs but IRRemote hangs. I have tried different timers (TC1..5 if I can even say I changed it at all)

so could someone validate I'm doing it the right way or if it's even possible?

Thanks

If a timer is used by different libraries, you will get linker errors; that is what your link is solving. I'm not familiar with the MKR1000 but I think that it will help if you post your code (don't forget the code tags :wink:).

#include <IRremote.hpp>
#include <WiFi101.h>

char ssid[] = "jebnato";           //  your network SSID (name) between the " "
char pass[] = "***";  // your network password between the " "

#define IR_RECEIVE_PIN 1

WiFiClient client;
int status = WL_IDLE_STATUS;       //connection status

void printWifiStatus() {
  // print the SSID of the network you're attached to:

  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());
  // print your board's IP address:

  IPAddress ip = WiFi.localIP();

  Serial.print("IP Address: ");

  Serial.println(ip);
  // print the received signal strength:

  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");

  Serial.print("To see this page in action, open a browser to http://");
  Serial.println(ip);
}


void enable_WiFi() {
  String fv = WiFi.firmwareVersion();

  if (fv < "1.0.0") {
    Serial.println("Please upgrade the firmware");
  }
}

void connect_WiFi() {
  Serial.print("Attempting to connect to SSID: ");
  Serial.println(ssid);

  status = WiFi.begin(ssid, pass);
}

void setup() {
  Serial.begin(9600);
  Serial.println("starting");

  enable_WiFi();
  connect_WiFi();
  printWifiStatus();

  Serial.println("started");

  IrReceiver.begin(IR_RECEIVE_PIN, false);
}

void loop() {
  if (IrReceiver.decode()) {
    Serial.println(IrReceiver.decodedIRData.decodedRawData);


    if (IrReceiver.decodedIRData.decodedRawData == 2516879342) {
      Serial.println("one");
    }


    if (IrReceiver.decodedIRData.decodedRawData == 2516748270) {
      Serial.println("two");
    }

    IrReceiver.resume();  // Enable receiving of the next value
  }
}

this is it. wifi connects, IR receives one or sometimes ten commands and then it hangs.
when you comment out

  enable_WiFi();
  connect_WiFi();
  printWifiStatus();

IR works as expected. Simply IR can not coexist with wifi on this board or just for a little while;

no one knows

What is the IR feedback LED doing?

I don't have one

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.