ESP32-S2-DEVKITM-1-ROBOCLAW 2X15A

General discussion of using Roboclaw motor controllers
Post Reply
emre
Posts: 1
Joined: Mon Jun 06, 2022 3:12 am
ESP32-S2-DEVKITM-1-ROBOCLAW 2X15A

Post by emre »

hello there,
I am using esp32-s2-devkitm-1 processor for an application. I am using 2x15A motor driver as motor driver. My problem is that esp32 doesn't recognize roboclaw when I do Interrupts. My codes are as follows. Can you help?


#include "RoboClaw.h"
const int buton = 35;
boolean butondurum = 0;
RoboClaw roboclaw(&Serial, 100);



void IRAM_ATTR butonKontrol() {
butondurum = 1;

}


void setup() {
// Serial.begin(115200);
// put your setup code here, to run once:
roboclaw.begin(115200);
pinMode(buton, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(buton), butonKontrol, RISING);

}

void loop() {
// put your main code here, to run repeatedly:
if (butondurum = 1){
roboclaw.BackwardM1 (0X80,120);
/// Serial.println("buton basıldı");
delay(10000);
butondurum = 0 ;
}
else {
roboclaw.ForwardM1 (0X80,120);
}
}
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: ESP32-S2-DEVKITM-1-ROBOCLAW 2X15A

Post by Basicmicro Support »

You will probably need to ask this on a ESP32 forum. I suspect if the problem only happens when using interrupts the fix will be something about disabling interrupts when communicating to the Roboclaw, but I dont know enough about the ESP32 to give you a detailed response.

Post Reply