Welcome! Log In Create A New Profile

Advanced

Cannot define heatbed sensor confused smiley

Posted by Lenny25 
Cannot define heatbed sensor confused smiley
June 24, 2022 06:16AM
Hey peeps,

I'm running Marlin 2 on Ramps 1.4 board, using the Arduino IDE. Everything is working perfectly and Marlin is compiling and flashing to the Arduino just fine, until I change the #define temp_sensor_heatbed 0 to #define temp_sensor_heatbed 1. I've tried changing the 0 value to all sorts of other values (the bed thermistor is a generic 100KOhms NTC), but no matter what I change it to, it always fails to compile. If I change it back to 0, everything is fine and dandy once again.

The error messages are as follows:

In file included from C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfigPre.h:37:0,
                 from C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:28,
                 from C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\MarlinCore.h:24,
                 from C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\module\temperature.cpp:30:
C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\module\temperature.cpp: In static member function 'static void Temperature::manage_heater()':
C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\core\macros.h:285:39: error: expected primary-expression before ')' token
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                       ^
C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\module\temperature.cpp:1781:38: note: in expansion of macro 'WITHIN'
           temp_bed.soft_pwm_amount = WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0;
                                      ^~~~~~
C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\module\temperature.cpp: In member function 'void Temperature::init()':
C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\module\temperature.cpp:2780:64: error: expected primary-expression before ')' token
     while (analog_to_celsius_bed(mintemp_raw_BED) < BED_MINTEMP) mintemp_raw_BED += TEMPDIR(BED) * (OVERSAMPLENR);
                                                                ^
C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\module\temperature.cpp: In static member function 'static bool Temperature::auto_job_over_threshold()':
C:\Users\OEM\Desktop\3d Printer\Marlin-bugfix-2.1.x\Marlin\src\module\temperature.cpp:3000:9: error: expected primary-expression before '||' token
         || TERN0(HAS_HEATED_CHAMBER, degTargetChamber() > CHAMBER_MINTEMP);
         ^~
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

Any ideas what's going on? and how I can fix it?

Thanks in advance

Edited 1 time(s). Last edit at 06/24/2022 06:17AM by Lenny25.
Re: Cannot define heatbed sensor confused smiley
June 24, 2022 06:51AM
#define TEMP_SENSOR_BED 1

works as expected


temp_sensor_heatbed is not valid.

you cannot randomly change defines or the case of the defines, the code must be updated to match

Edited 1 time(s). Last edit at 06/24/2022 06:59AM by Dust.
Re: Cannot define heatbed sensor confused smiley
June 24, 2022 06:58AM
You would need to upload your configs for closer examination
Re: Cannot define heatbed sensor confused smiley
June 24, 2022 07:10AM
Cool, I've attached the files
Attachments:
open | download - Configuration.h (117.1 KB)
open | download - Configuration_adv.h (183.2 KB)
Re: Cannot define heatbed sensor confused smiley
June 24, 2022 07:14AM
Quote
Dust

temp_sensor_heatbed is not valid.

you cannot randomly change defines or the case of the defines, the code must be updated to match

Sorry I was just typing it out in the post, in the config I havn't changed the case, just the value that denotes which thermistor I'm using. It works fine when defined as '0' but not as anything else, like '1'
Re: Cannot define heatbed sensor confused smiley
June 24, 2022 07:23AM
#define BED_MINTEMP

this needs a value after it

Edited 1 time(s). Last edit at 06/24/2022 07:24AM by Dust.
Re: Cannot define heatbed sensor confused smiley
June 24, 2022 07:42AM
Thank you so much!

Problem solved! - much appreciated @Dust
Sorry, only registered users may post in this forum.

Click here to login