I'm trying to control a 28BYJ-48 stepper motor with an IR remote, and up until now I've had success getting it to move, but now I can't get rid of this error.
Why did you put the "HEX" there. Have you ever seen that in any other code?
Despite the fact that you wrote things in hexidecimal in your sketch, to the processor it is ALL binary. When you are using Serial.print then you can put that "HEX" out there to tell print to use hexidecimal when it prints. But you can't just stick "HEX" wherever you want.
@jbherb if you did not get a warning, it is because you have not yet gone to the IDE preferences to dial up all verbosity and warnings.
Do it now. Rightnow. Then whenever you verify or upload, heed the red ink. Most warnings are easily avoided, and many warnings are really telling you things you need to pay attention to.
Why they are not turned on by default has always baffled me.
Because the core code throws so many compiler warnings that it can sometimes be nearly impossible to scroll through and find the error that actually relates to your code.
If they would correct some of the issues in the core then I would agree with you. But as of right now leaving the warnings all the way up creates a lot of extra distracting stuff every time I compile.
I've said this before and I have yet to hear anyone give a good excuse for why it shouldn't be right. "Core code should not throw warnings!"
LOL. I guess I am better at ignoring noise. So good, in fact, that I often fail to see my own mistakes what spill the red ink. Until I'm grasping at straws and pulling a few remaining hairs off my head.
THX, I do believe I've asked and you've answered in the past. Obvsly it does not the hold in my memory.
I end up switching them on and off. When I'm writing basic code I'll usually have the warnings to a minimum until I'm chasing a bug. Then I'll crank it up to "All" and start going through them. If I'm writing code to share like a library or something, then I'll kick them up right at the end as a sort of check to make sure I didn't miss something.
Thanks,
I took the HEX out, and it stopped giving me that error. You also mentioned the case values. How should I set them up using the decoded raw data?
I don't know what you mean. The only error you revealed was the duplicate case label error, which would not have been solved with that edit.
Since you are still asking about the real problem, I assume you are still getting the duplicate case label error.
I don't know the best what to proceed, but it looks like your case label are unique in the high order 16 bits, so
unsigned long longIRCode = IrReceiver.decodedIRData.decodedRawData >> 16;
unsigned int intIRCode = longIRCode;
switch (intIRCode) {
case 0xE31C:
myStepper.setSpeed(500);
steps = 2048;
delay(2000);
break;
case 0xE718:
myStepper.setSpeed(0);
steps = 0;
delay(2000);
break;
case 0xAD52:
would just use the high order bits. Use better names than I did, and maybe print out the values - I'm under the umbrella just now or I would test my suggestion.