Go Down

Topic: Intermittent compiler complaints of 'Point' does not define a type (Read 2 times) previous topic - next topic

Nick Gammon

Does it compile for you? I get:

Code: [Select]
tinyComm.cpp: In function 'boolean MoveX(float, int)':
tinyComm:259: error: void value not ignored as it ought to be
tinyComm.cpp: In function 'boolean MoveX(int)':
tinyComm:273: error: void value not ignored as it ought to be
tinyComm.cpp: In function 'boolean MoveY(float, int)':
tinyComm:284: error: void value not ignored as it ought to be
tinyComm.cpp: In function 'boolean MoveY(int)':
tinyComm:298: error: void value not ignored as it ought to be
http://www.gammon.com.au/electronics

ajofscott

I attached the modified lib and header, but to get it to compile on your system without changing Servo libraries change the calls to X_Axis.step() and Y_Axis.step() to read 1 * DD.

ajofscott

While running the machine making test cuts I noted my Current cursor is remaining 0,0. Is this statement being interpreted as 'A replaced with NOT B'?
Code: [Select]

Current.X != ThisOperation.Begin.X

Where my premise was != meant the same as <> or not equal to.

ajofscott

The Y error was due to not closing the command with a whitespace char.
MA 1234 4567 89FA BCDE* although reporting back on the acknowledge as 'MA 1234 4567 89FA BCDE' was being processed into the command
structure as 'MA 1234 4567 89FA BCD'. I did not find this until I added a code for querying the current coordinate and discovered
RP* did not report but RP * did.
For those who are reading and may not know the format based on reading the code....
Verb (2 bytes) space BeginX (4 Bytes) space BeginY (4 Bytes) space FinishX ( 4 Bytes) space FinishY (4 Bytes) space ArcCenterX (4 Bytes) space ArcCenterY (4 Bytes) space BeginAngle (4 bytes) space EndingAngle (4 Bytes) space ToolDiameter (4 Bytes) space ToolBias (1 Byte) space * (end of command).
Some commands do not use all fields and in those cases all fields right of the last applicable field are not sent and the * appears at the begin of the next field, unused fields between the verb field and the end of command are filled with XXXX. An 'X' causes the Chex function to return a -1 which is an invalid hexadecimal value as -1 would be FE. My command set is growing faster than I can code the commands I already wanted. I am however making strides toward the end goal with one squashed bug at a time! If you are merely "browsing" and have a question of curiosity ask it please! It may not be as dumb of a question as you might convince yourself it is.

Nick Gammon


While running the machine making test cuts I noted my Current cursor is remaining 0,0. Is this statement being interpreted as 'A replaced with NOT B'?
Code: [Select]

Current.X != ThisOperation.Begin.X

Where my premise was != meant the same as <> or not equal to.


That isn't a statement. It would be if it had a semicolon on the end.

Code: [Select]
void setup ()
{
  int a, b = 5;
 
  a != b;
 
  Serial.begin (115200);
  Serial.println ();
  Serial.println (a);
  Serial.println (b);
 
}
void loop () {}


Output:

Code: [Select]
0
5


So yes, it appears to do that, but why not write:

Code: [Select]
Current.X = ! ThisOperation.Begin.X;

Wouldn't that be clearer?
http://www.gammon.com.au/electronics

ajofscott

It was not intended as an assignment but was in a conditional comparison. I have gone through near 50 variations of the MA case code, and have reduced it to a vectorMove function and do my monkey business by swapping what i send the function. It also had the benefit of cropping almost 1kb of code in the compiled product. If you want the current ino let me knoe, and I'll post it, otherwise I'll continue on to a more complete command set.

Nick Gammon


While running the machine making test cuts I noted my Current cursor is remaining 0,0. Is this statement being interpreted as 'A replaced with NOT B'?
Code: [Select]

Current.X != ThisOperation.Begin.X

Where my premise was != meant the same as <> or not equal to.


...

Quote
but was in a conditional comparison


In that case nothing is being replaced. It is just saying: is "Current.X" not equal to "ThisOperation.Begin.X".

Nothing is being replaced or changed.
http://www.gammon.com.au/electronics

ajofscott

the switchcase statement reduced to this:
Code: [Select]

case 0x4D41: //Move Absolute 'MA' or 'ma' Cutter is moved to Begin.X and Begin.Y then moved to Finish.X and Finish.Y
  {
    if((Current.X != ThisOperation.Begin.X)||(Current.Y != ThisOperation.Begin.Y))
     {
        VectorMove(Current, ThisOperation.Begin);
      }
    VectorMove(ThisOperation.Begin, ThisOperation.Finish);
    break;
  }

For the record the forum needs to look for Chr(09) 'tab' and replace it with Chr(32) Chr(32). This re edit is nothing short of a pain.

Nick Gammon

I reject tabs and substitute spaces. You can never know what someone else has their tabs set to.
http://www.gammon.com.au/electronics

Go Up