ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

#57  

I have inserted the code below it as you have mentioned and I took off the comments on debug. Made it go to position 1000 saw the RX led come on, ran the Home V1 code saw the RX led come on. Set the position to 1, saw the Rx led come on and it went 1000 steps back to 1(which it should not have moved). There is nothing connected to pin 13 on Mega or Uno. Does it have anything to do with setcurrentposition (0) which must mean cmd==0 rather than (0) zero in parenthesis being a position 0 which in AutoPosition means release and keep that position as is? Do I need to tie an led to pin 13 or is there supposed to be an led built into Uno and Mega because no other led is turning on other than RX when I send a position or Home command?

User-inserted image

User-inserted image

PRO
Synthiam
#58  

Move that led debug code into other cmd conditions to make sure it works. Or put it back outside of the cmd if condition and it should light for all commands. Just make sure it works before you start spinning in circles.

and no, everything you wrote about Auto Position and cmd = 0 is way off base. Cmd=0 just means 0 is setashome. And cmd is the variable that stores the cmd being sent. It has no relation to anything else. It’s an IF condition and cmd is a variable.

#59  

Just a question on this tread. Have been following it and curious why you have a "!' in front of the digitalRead(LED_BUILTIN));

#60  

OK I will have to make the changes later tonight or in the morning. I am at work now and I understand about the CMD. Thanks for explaining. Herr I will look into the ! Up until today I have not done any editing below the area where it says do not edit here so that must have been there before

PRO
Synthiam
#61   — Edited

A question mark means NOT

If (2== 2) print(yes)

if (2 != 3) print(yes)

if you use it in a Boolean then it’s NOT true or NOT false

bool variable = false

if (!variable) print(yes)

that’s the same as.

if (variable == false) print(yes)

PRO
Canada
#62  

@Herr Ball if you were looking for more context, it looks like they are using the NOT to toggle the LED from its last state. This is common in debugging. If the LED was ON now turn it OFF, if it was OFF now turn it ON.

#63  

I have been studying Python and " != " means not equal to. I seen the ! and wondered if it was accidentally placed there or the = sign was forgotten. Didnt mean to high jack this thread.

PRO
Synthiam
#64   — Edited

Herr Ball,

the ! means NOT... so you can use it where ever you'd use NOT. It's used in all programming languages, such as C, C++, Python, C#, JavaScript, Java, etc.......

  1. if it's != that means NOT EQUAL
var variable = false;

if (variable != true)
  print("false");
  1. if it's !(bool variable) that means NOT that boolean value
var variable = false;

if (!variable)
  print("false");