Problem Float soap

Hi everybody
When I Download the firmware for control my cnc maslow I have this ( open the picture please)!
I need yours help !!!
if possible in simple english (or in french), I don’t speak well !
Tanks you so much
Sloog

So your problem is with this file: Firmware/Motor.h at master · MaslowCNC/Firmware · GitHub.
And you got an error at the initialization of an element of a struct during a typedef.

struct LinSegment{
        float slope  = 1;
        float intercept = 0;
        //The bounds are strict, so if the bounds are 0,1 .9 would work
        //but 1 and 0 will not
        int positiveBound = 0;
        int negativeBound = 0;
};

It think the compiler is right. In my opinion, it is not possible to do that.
That code is automatically accepted as a typedef.

I think the 'slope' was used in the past, but it seems that it is no longer used. Perhaps you can try to comment it out.

struct LinSegment{
//        float slope  = 1;          ????
        float intercept = 0;
        //The bounds are strict, so if the bounds are 0,1 .9 would work
        //but 1 and 0 will not
        int positiveBound = 0;
        int negativeBound = 0;
};

I'm not understanding the problem in the initialization of the struct. Starting with C++11, it’s possible to give non-static (normal) struct members a default value.
https://www.learncpp.com/cpp-tutorial/47-structs/

This compiles and runs with 1.8.5 and a uno.

struct LinSegment{
        float slope  = 1;
        float intercept = 0;
        //The bounds are strict, so if the bounds are 0,1 .9 would work
        //but 1 and 0 will not
        int positiveBound = 0;
        int negativeBound = 0;
    };

void setup() {
  Serial.begin(115200);
  LinSegment segment1;
  Serial.println(segment1.slope);
  segment1.slope = 2.0;
  Serial.println(segment1.slope);
  
}

void loop() {

}

cattledog:
This compiles and runs with 1.8.5 and a uno.

Thanks, I did not know that. It compiles for Arduino Uno/Zero/MKR/101 and so on, also for ESP8266.

According to the screendump, a Arduino Mega 2560 is selected.

@sloog, have you been using Visual Studio with a plugin ? Do you have different build environments ? What operating system do you use ? Do you use linux and also have installed Arduino/Java/gcc packages from the repositories ? Perhaps your build environment is broken.

Hello and tks for your reply.
I have a job who’s take me a lot of time and working sometime in the morning and sometime in the evening so sleeping all the time :slight_smile:
but this morning I can give you a reply…
Tks for all
I have Instal the last acceptable arduino soft for my OS
OSX 10,6,8 Snow leopard
Arduino 1,6,1
I have now a new message

In file included from Axis.cpp:19:0:
Maslow.h:27:19: fatal error: Servo.h: No such file or directory
#include <Servo.h>
^
compilation terminated.
Erreur lors de la compilation.
Don’t know what to do with it ???

I think something is wrong with your build environment, but I don't know OSX.
Keep your sketches (Documents/Arduino) and your own downloaded libraries (Documents/Arduino/libraries) en uninstall Arduino. After uninstalling, check if there is still something and delete that, and also delete the hidden arduino15 folder.
Check your own downloaded libraries (Documents/Arduino/libraries) and remove the libraries that are already included with the Arduino IDE.
Then install the newest Arduino IDE.