iso c++ error for parsenumber in gcodecncdemo2axis

I try to compile gcodecncdemo2axis from here

but when compile i see this error:
"iso c++ forbids comparison between pointer and integer"

and i see that in gcodecncdemo2axis is:

...
  while(ptr>1 && *ptr && ptr<buffer+sofar) {
...
ptr=strchr(ptr,' ');
...

and in gcodecncdemo4axis :

...
  while(ptr && *ptr && ptr<buffer+sofar) {
...
ptr=strchr(ptr,' ')+1;
...

so ... in one ..." ptr>1" and in another only "ptr"
thanks!

Don't put code in images...

a pointer is always positive or null. when it's null, it means "undefined pointer" otherwise it indicates a byte location somewhere in memory. So > 1 is a way that is kinda technically almost correct to express the idea that it's not 0 (nor 1 as actually would be a bug if you were pointing at memory location 1...)

Now, semantically a pointer is not a number, it's an abstraction representing a memory address and thus the compiler does not like the idea of comparing with integers unless you were to cast that integer into an address.

Just do ptr != NULL && (which is very readable) or just indeed ptr && (which is kinda the same, the compiler transforms this into a boolean expression which will test the pointer against 0 which which is the null pointer properly cast, and return true or false) instead of > 1 which does not make much sense

Thanks!
The gcodecncdemo4axis can be compiled but have many bug and is too large to understend the code!
So ... the gcodecncdemo2axis is small and i can see and understand the code more easy ... but have many bugs!
Another error:


This error i try many times when try to compile another programs...
can be double library for one function?
Is a easy to fix?
wiring.c:49 or stepper.c:416 for __vector_16
i can delete one of this line?
I want hear only that is easy to fix problems or maybe is a good idea to leave this program?
Because is many copy of this file on internet ... but all is same... i dont know if is file broken... i thing that my arduino program is not set corectly !

It's impossible to read the text in your image. So please post your error messages as code or as a quote

why do you keep posting text as imaged? just copy and paste...

(the error you see (and we can't) is probably about 2 libraries trying to use the same interrupt)

Actually exists many programs and microcontrollers!
But the cheap way is arduino atmega328 with grbl .
But not remain space to include more code and grbl for atmega168 not find anywhere.
Second problem is that now is generally used microusb connector (fig 1):


But majority of arduino nano have miniusb (2)...
so ... not only with programs is problems... :slight_smile:

ok!

core.a(wiring.c.o): In function `__vector_16':
F:\$_ce _trebuie_avr\arduino-1.0.4-windows\arduino-1.0.4\hardware\arduino\cores\arduino/wiring.c:49: multiple definition of `__vector_16'
grbl\stepper.c.o:F:\$_ce _trebuie_avr\arduino-1.0.4-windows\arduino-1.0.4\libraries\grbl/stepper.c:416: first defined here
core.a(HardwareSerial.cpp.o): In function `__vector_18':
F:\$_ce _trebuie_avr\arduino-1.0.4-windows\arduino-1.0.4\hardware\arduino\cores\arduino/HardwareSerial.cpp:116: multiple definition of `__vector_18'
grbl\serial.c.o:F:\$_ce _trebuie_avr\arduino-1.0.4-windows\arduino-1.0.4\libraries\grbl/serial.c:160: first defined here
core.a(HardwareSerial.cpp.o): In function `__vector_19':
F:\$_ce _trebuie_avr\arduino-1.0.4-windows\arduino-1.0.4\hardware\arduino\cores\arduino/HardwareSerial.cpp:229: multiple definition of `__vector_19'
grbl\serial.c.o:F:\$_ce _trebuie_avr\arduino-1.0.4-windows\arduino-1.0.4\libraries\grbl/serial.c:106: first defined here

but same you can click right mouse on photo and click "open image in another window"

but same you can click right mouse on photo and click "open image in another window"

why would you make it complicated for you and us to help you out?
Text is easy to copy and paste, and "older folks" like me don't need glasses and can just increase font size to read about it :slight_smile:

As said above - the error you see is about 2 libraries trying to use the same interrupt. Where did you get then code from?

J-M-L:
why would you make it complicated for you and us to help you out?
Text is easy to copy and paste, and "older folks" like me don't need glasses and can just increase font size to read about it :slight_smile:

As said above - the error you see is about 2 libraries trying to use the same interrupt. Where did you get then code from?

from here :

thanks!
So... the problem can be that have installed too many libraries in arduino libraries folder?

yeeeeeessssss

I delete a folder grbl from libraries , and now i can compiling!
But i thing that problems no finished here ! :slight_smile: