New Saga of IR remote issues

Start for ground zero and see If I can get this correct. I am using a Mega 2560 and I have no idea what the specs are for the IR receiver as it cam with an Elegoo Kit as did the remote. The Stepper I am using is an Applied Motion STM23 NEMA23. If I interpret correctly the IR runs @ 38khz.

#include <AccelStepper.h>
#include <IRremote.h>

#define One_button  0xFF30CF // code received from one button
#define Two_button  0x4eb308f7     // code received from two button
#define Four_button  0x4eb3f00f    // code received from four button

// Define sensor pin
int RECV_PIN = 11;               //output pin of IR receiver to pin 4 of arduino



AccelStepper stepper(1,3,6); // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5

IRrecv irrecv(RECV_PIN);  //Arduino will take output of IR receiver from pin 4
decode_results output;


void setup()
{
   // Serial Monitor @ 9600 baud
   Serial.begin(9600);

   // Enable the IR Receiver
   irrecv.enableIRIn();

  

}

void loop()
{
   {
      if (irrecv.decode(&output))
      {         
         unsigned long value = output.value; // **** change to unsigned long
         Serial.println(value, HEX);         
         switch (value)
         {
            case One_button:
               stepper.setMaxSpeed(5000);
               stepper.setSpeed(-3000); 
               stepper.runSpeed();
               
               break;
               case Two_button:
               stepper.setMaxSpeed(5000);
               stepper.setSpeed(3000); 
               stepper.runSpeed();

               
               break;
            case Four_button:
              stepper.setMaxSpeed(10000);
              stepper.setSpeed(.0073125);
              stepper.runSpeed();
               break;
         }
         
         irrecv.resume();
      }
   }
}

I attempted to ad an image to the last post but did something wrong. I'll try again.

This is my 3rd try.

Try the first advicing topics like "How to...." and see if that helps You.

Why are you starting a new thread for the virtually the same question as here. You have some answers in the other thread and some unanswered questions. If you will not respond, it makes it much harder to help you.

Post a schematic.

As mentioned by blh64, you must call runSpeed() every time through loop() or use a blocking function to control the motor (not ideal).

Here is your code modified for my setup (motor pins changed, One_button changed to match my remote. And because I am using a CNC shield, I must create an enable pin and set it output and low. Other wise the only change to the loop() function is to move runSpeed() out of the cases and call it every time through loop(). Tested, successfully, with my Uno, CNC shield and stepper. Changes marked with // **************

#include <AccelStepper.h>
#include <IRremote.h>

#define One_button  0x4eb3c837 // code received from one button *****************
#define Two_button  0x4eb308f7     // code received from two button
#define Four_button  0x4eb3f00f    // code received from four button

// Define sensor pin
int RECV_PIN = 11;               //output pin of IR receiver to pin 11 of arduino

const byte enablePin = 8; //**************

AccelStepper stepper(1, 2, 5); //*********

IRrecv irrecv(RECV_PIN);  //Arduino will take output of IR receiver from pin 4
decode_results output;

void setup()
{
   // Serial Monitor @ 9600 baud
   Serial.begin(9600);

   // Enable the IR Receiver
   irrecv.enableIRIn();
   pinMode(enablePin, OUTPUT);  //**********
   digitalWrite(enablePin, LOW); //***********
}

void loop()
{
   {
      if (irrecv.decode(&output))
      {
         unsigned long value = output.value; // **** change to unsigned long
         Serial.println(value, HEX);
         switch (value)
         {
            case One_button:
               stepper.setMaxSpeed(5000);
               stepper.setSpeed(-3000);
               break;
            case Two_button:
               stepper.setMaxSpeed(5000);
               stepper.setSpeed(3000);
               break;
            case Four_button:
               stepper.setMaxSpeed(10000);
               stepper.setSpeed(1);
               stepper.setMaxSpeed(10000);
               break;
         }
         irrecv.resume();
      }
   }
   stepper.runSpeed();  //**********
}

Thank you! I seemed to get the message I needed to start anew as opposed to continuing in the "hijacked" thread.

The moderator already moved your post to its own thread. You can ask a moderator to merge this thread with the other one so all is in one place.

Yes Moderator do whatever is appropriate. I aplogize for poor online etiquite.

Attached is an image of the schematic.

Attached where? I can't see a trace of it.

See below, I have tried multiple times to post an image, a link to an image on the cloud etc. etc,
There was a problem during the uploading of Stepper & Arduino.jpg.
Your post has been made, however the above attachment was not attached. Please use the Back button to edit your post and submit any required changes.Your attachment has failed security checks and cannot be uploaded. Please consult the forum administrator.

Because I seem to be unable to post any images I will textualize a schematic.
Enable - to gnd
Enable + to pin 8
Dir- to gnd
Dir+ to pin 6
Step - to gnd
Step + to pin 3
IR recvr out to pin 11

That pretty well is the thing. I think I have something amiss with my remote unit or the IR recvr. The serial output from a key press is different everytime I press a #1 for instance. And none of the codes are similar to codes used in sketch to identify a key. As an example here is a serial interface print out of pressing the #1 C40BD817 and the next time I pressed #1 F92C97C2. Is this normal?

What about the powering of things? What about GND cables?

Get new power and get along posting a wiring. Those poetical descriptions always lacks information.

I repeat: Have you successfully ran some of the IRremote library examples (with nothing else connected to the Arduino)?

What is powering the motor?

Yes, I ran the example in IRremote for a dump. None of the codes are what you would expect. Similar to above not what I expect to see as Hex codes. When inserted into the sketch they produced error messages.

Power supply is a stand alone DC 0-48 volt supply. Runs the motor just fine.

By the way. What is Your question? What is happening and what do You want to happen?

I would like to know what/why I get nothing from my remote. I can run the routine portion of my sketchs manually and it works just fine. My remote will not communicate properly I think. I am leaning toward I need either/both a new receiver and remote. I have changed boards to an UNO from a mega 2560 and same result. Still unable to psot an image and yes I have read about it.

Dig down, read the first topics like "How to...." and post the wiring diagram, not any poetry.
My crystal ball tells me nothing.

Did you try running the example sketches from the IR library?