Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
c495ec3c
Commit
c495ec3c
authored
9 years ago
by
MagoKimbra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Same fix
parent
41fd5785
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
92 deletions
+89
-92
nextion_lcd.cpp
MarlinKimbra/nextion_lcd.cpp
+61
-57
pins.h
MarlinKimbra/pins.h
+19
-9
temperature.cpp
MarlinKimbra/temperature.cpp
+7
-24
thermistortables.h
MarlinKimbra/thermistortables.h
+2
-2
No files found.
MarlinKimbra/nextion_lcd.cpp
View file @
c495ec3c
...
...
@@ -26,78 +26,79 @@
static
millis_t
next_lcd_update_ms
;
// Page
NexPage
Pstart
=
NexPage
(
0
,
0
,
"start"
);
NexPage
Pinfo
=
NexPage
(
1
,
0
,
"info"
);
NexPage
Ptemp
=
NexPage
(
2
,
0
,
"temp"
);
NexPage
Pmenu
=
NexPage
(
3
,
0
,
"menu"
);
NexPage
Psdcard
=
NexPage
(
4
,
0
,
"sdcard"
);
NexPage
Psetup
=
NexPage
(
5
,
0
,
"setup"
);
NexPage
Pstart
=
NexPage
(
0
,
0
,
"start"
);
NexPage
Pinfo
=
NexPage
(
1
,
0
,
"info"
);
NexPage
Ptemp
=
NexPage
(
2
,
0
,
"temp"
);
NexPage
Pmenu
=
NexPage
(
3
,
0
,
"menu"
);
NexPage
Psdcard
=
NexPage
(
4
,
0
,
"sdcard"
);
NexPage
Psetup
=
NexPage
(
5
,
0
,
"setup"
);
// Text
NexText
Hotend0
=
NexText
(
1
,
1
,
"t0"
);
NexText
Hotend1
=
NexText
(
1
,
4
,
"t1"
);
NexText
Hotend2
=
NexText
(
1
,
5
,
"t2"
);
NexText
Hotend21
=
NexText
(
1
,
6
,
"h2"
);
NexText
LedStatus
=
NexText
(
1
,
7
,
"t4"
);
NexText
LedCoord
=
NexText
(
1
,
8
,
"t5"
);
NexText
set0
=
NexText
(
2
,
2
,
"set0"
);
NexText
set1
=
NexText
(
2
,
15
,
"set1"
);
NexText
sdrow0
=
NexText
(
4
,
3
,
"t0"
);
NexText
sdrow1
=
NexText
(
4
,
4
,
"t1"
);
NexText
sdrow2
=
NexText
(
4
,
5
,
"t2"
);
NexText
sdrow3
=
NexText
(
4
,
6
,
"t3"
);
NexText
sdrow4
=
NexText
(
4
,
7
,
"t4"
);
NexText
sdrow5
=
NexText
(
4
,
8
,
"t5"
);
NexText
sdfolder
=
NexText
(
4
,
23
,
"sdfolder"
);
NexText
Hotend0
=
NexText
(
1
,
1
,
"t0"
);
NexText
Hotend1
=
NexText
(
1
,
4
,
"t1"
);
NexText
Hotend2
=
NexText
(
1
,
5
,
"t2"
);
NexText
Hotend21
=
NexText
(
1
,
6
,
"h2"
);
NexText
LedStatus
=
NexText
(
1
,
7
,
"t4"
);
NexText
LedCoord
=
NexText
(
1
,
8
,
"t5"
);
NexText
set0
=
NexText
(
2
,
2
,
"set0"
);
NexText
set1
=
NexText
(
2
,
15
,
"set1"
);
NexText
sdrow0
=
NexText
(
4
,
3
,
"t0"
);
NexText
sdrow1
=
NexText
(
4
,
4
,
"t1"
);
NexText
sdrow2
=
NexText
(
4
,
5
,
"t2"
);
NexText
sdrow3
=
NexText
(
4
,
6
,
"t3"
);
NexText
sdrow4
=
NexText
(
4
,
7
,
"t4"
);
NexText
sdrow5
=
NexText
(
4
,
8
,
"t5"
);
NexText
sdfolder
=
NexText
(
4
,
23
,
"sdfolder"
);
// Picture
NexPicture
Menu
=
NexPicture
(
1
,
10
,
"p0"
);
NexPicture
MSD
=
NexPicture
(
1
,
11
,
"p1"
);
NexPicture
MSetup
=
NexPicture
(
1
,
12
,
"p2"
);
NexPicture
Hend0
=
NexPicture
(
1
,
13
,
"p3"
);
NexPicture
Hend1
=
NexPicture
(
1
,
14
,
"p4"
);
NexPicture
Hend2
=
NexPicture
(
1
,
15
,
"p5"
);
NexPicture
Fanpic
=
NexPicture
(
1
,
19
,
"p6"
);
NexPicture
Folder0
=
NexPicture
(
4
,
9
,
"p0"
);
NexPicture
Folder1
=
NexPicture
(
4
,
10
,
"p1"
);
NexPicture
Folder2
=
NexPicture
(
4
,
11
,
"p2"
);
NexPicture
Folder3
=
NexPicture
(
4
,
12
,
"p3"
);
NexPicture
Folder4
=
NexPicture
(
4
,
13
,
"p4"
);
NexPicture
Folder5
=
NexPicture
(
4
,
14
,
"p5"
);
NexPicture
Folderup
=
NexPicture
(
4
,
15
,
"p6"
);
NexPicture
Exit
=
NexPicture
(
4
,
16
,
"p7"
);
NexPicture
Menu
=
NexPicture
(
1
,
10
,
"p0"
);
NexPicture
MSD
=
NexPicture
(
1
,
11
,
"p1"
);
NexPicture
MSetup
=
NexPicture
(
1
,
12
,
"p2"
);
NexPicture
Hend0
=
NexPicture
(
1
,
13
,
"p3"
);
NexPicture
Hend1
=
NexPicture
(
1
,
14
,
"p4"
);
NexPicture
Hend2
=
NexPicture
(
1
,
15
,
"p5"
);
NexPicture
Fanpic
=
NexPicture
(
1
,
19
,
"p6"
);
NexPicture
Folder0
=
NexPicture
(
4
,
9
,
"p0"
);
NexPicture
Folder1
=
NexPicture
(
4
,
10
,
"p1"
);
NexPicture
Folder2
=
NexPicture
(
4
,
11
,
"p2"
);
NexPicture
Folder3
=
NexPicture
(
4
,
12
,
"p3"
);
NexPicture
Folder4
=
NexPicture
(
4
,
13
,
"p4"
);
NexPicture
Folder5
=
NexPicture
(
4
,
14
,
"p5"
);
NexPicture
Folderup
=
NexPicture
(
4
,
15
,
"p6"
);
NexPicture
Exit
=
NexPicture
(
4
,
16
,
"p7"
);
// Progress Bar
NexProgressBar
sdbar
=
NexProgressBar
(
1
,
26
,
"j0"
);
// Slider
NexSlider
sdlist
=
NexSlider
(
4
,
1
,
"h0"
);
NexSlider
sdlist
=
NexSlider
(
4
,
1
,
"h0"
);
// Wafeform
NexWaveform
Graph0
=
NexWaveform
(
1
,
9
,
"s0"
);
NexWaveform
Graph1
=
NexWaveform
(
1
,
24
,
"s1"
);
NexWaveform
Graph2
=
NexWaveform
(
1
,
25
,
"s2"
);
NexWaveform
Graph0
=
NexWaveform
(
1
,
9
,
"s0"
);
NexWaveform
Graph1
=
NexWaveform
(
1
,
24
,
"s1"
);
NexWaveform
Graph2
=
NexWaveform
(
1
,
25
,
"s2"
);
// Touch area
NexHotspot
hot0
=
NexHotspot
(
1
,
14
,
"hot0"
);
NexHotspot
hot1
=
NexHotspot
(
1
,
16
,
"hot1"
);
NexHotspot
hot2
=
NexHotspot
(
1
,
18
,
"hot2"
);
NexHotspot
m11
=
NexHotspot
(
2
,
14
,
"m11"
);
NexHotspot
tup
=
NexHotspot
(
2
,
16
,
"tup"
);
NexHotspot
tdown
=
NexHotspot
(
2
,
17
,
"tdown"
);
NexHotspot
hot0
=
NexHotspot
(
1
,
14
,
"hot0"
);
NexHotspot
hot1
=
NexHotspot
(
1
,
16
,
"hot1"
);
NexHotspot
hot2
=
NexHotspot
(
1
,
18
,
"hot2"
);
NexHotspot
m11
=
NexHotspot
(
2
,
14
,
"m11"
);
NexHotspot
tup
=
NexHotspot
(
2
,
16
,
"tup"
);
NexHotspot
tdown
=
NexHotspot
(
2
,
17
,
"tdown"
);
// Timer
NexTimer
startimer
=
NexTimer
(
0
,
1
,
"tm0"
);
NexTimer
fantimer
=
NexTimer
(
1
,
23
,
"tm0"
);
NexTimer
startimer
=
NexTimer
(
0
,
1
,
"tm0"
);
NexTimer
fantimer
=
NexTimer
(
1
,
23
,
"tm0"
);
// Variable
NexVar
Hotend
=
NexVar
(
1
,
20
,
"he"
);
NexVar
Bed
=
NexVar
(
1
,
21
,
"bed"
);
NexVar
filename0
=
NexVar
(
4
,
19
,
"va0"
);
NexVar
filename1
=
NexVar
(
4
,
20
,
"va1"
);
NexVar
filename2
=
NexVar
(
4
,
21
,
"va2"
);
NexVar
filename3
=
NexVar
(
4
,
22
,
"va3"
);
NexVar
filename4
=
NexVar
(
4
,
23
,
"va4"
);
NexVar
filename5
=
NexVar
(
4
,
24
,
"va5"
);
NexVar
Hotend
=
NexVar
(
1
,
20
,
"he"
);
NexVar
Bed
=
NexVar
(
1
,
21
,
"bed"
);
NexVar
filename0
=
NexVar
(
4
,
19
,
"va0"
);
NexVar
filename1
=
NexVar
(
4
,
20
,
"va1"
);
NexVar
filename2
=
NexVar
(
4
,
21
,
"va2"
);
NexVar
filename3
=
NexVar
(
4
,
22
,
"va3"
);
NexVar
filename4
=
NexVar
(
4
,
23
,
"va4"
);
NexVar
filename5
=
NexVar
(
4
,
24
,
"va5"
);
NexTouch
*
nex_listen_list
[]
=
{
...
...
@@ -468,7 +469,7 @@
color
=
65519
;
else
if
(
prc
>=
75
&&
prc
<
95
)
color
=
64487
;
else
if
(
prc
>=
95
&&
prc
<
100
)
else
if
(
prc
>=
95
)
color
=
63488
;
hotend_list
[
h
]
->
setText
(
buffer
);
...
...
@@ -548,6 +549,9 @@
MSD
.
setPic
(
7
);
else
MSD
.
setPic
(
6
);
if
(
IS_SD_PRINTING
)
// Progress bar solid part
sdbar
.
setValue
(
card
.
percentDone
());
#endif
next_lcd_update_ms
=
ms
+
LCD_UPDATE_INTERVAL
;
...
...
This diff is collapsed.
Click to expand it.
MarlinKimbra/pins.h
View file @
c495ec3c
...
...
@@ -2249,9 +2249,7 @@
#define ORIG_TEMP_0_PIN 6 // ANALOG NUMBERING
#define ORIG_TEMP_1_PIN 5 // 2 // ANALOG NUMBERING
#define ORIG_TEMP_2_PIN 4 // 3 // ANALOG NUMBERING
#define ORIG_TEMP_3_PIN -1 // ANALOG NUMBERING
#define TEMP_4_PIN -1 // ANALOG NUMBERING
#define ORIG_TEMP_3_PIN 3 // ANALOG NUMBERING
#if NUM_SERVOS > 0
#define SERVO0_PIN 11
...
...
@@ -2381,20 +2379,20 @@
#define ORIG_X_STEP_PIN 54
#define ORIG_X_DIR_PIN 55
#define ORIG_X_ENABLE_PIN 38
#define ORIG_X_MIN_PIN
3
#define ORIG_X_MAX_PIN
2
#define ORIG_X_MIN_PIN 3
#define ORIG_X_MAX_PIN 2
#define ORIG_Y_STEP_PIN 60
#define ORIG_Y_DIR_PIN 61
#define ORIG_Y_ENABLE_PIN 56
#define ORIG_Y_MIN_PIN
14
#define ORIG_Y_MAX_PIN
15
#define ORIG_Y_MIN_PIN 14
#define ORIG_Y_MAX_PIN 15
#define ORIG_Z_STEP_PIN 46
#define ORIG_Z_DIR_PIN 48
#define ORIG_Z_ENABLE_PIN 62
#define ORIG_Z_MIN_PIN
18
#define ORIG_Z_MAX_PIN
19
#define ORIG_Z_MIN_PIN 18
#define ORIG_Z_MAX_PIN 19
#define Y2_STEP_PIN 36
#define Y2_DIR_PIN 34
...
...
@@ -2412,6 +2410,18 @@
#define ORIG_E1_DIR_PIN 34
#define ORIG_E1_ENABLE_PIN 30
#define ORIG_HEATER_0_PIN 10
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_HEATER_BED_PIN 8 // BED
#define ORIG_TEMP_0_PIN 9 // ANALOG NUMBERING
#define ORIG_TEMP_1_PIN -1 // ANALOG NUMBERING
#define ORIG_TEMP_2_PIN -1 // ANALOG NUMBERING
#define ORIG_TEMP_BED_PIN 10 // ANALOG NUMBERING
#define ORIG_FAN_PIN 9
#define PS_ON_PIN 12
#define SDPOWER -1
#define SDSS 53
#define LED_PIN 13
...
...
This diff is collapsed.
Click to expand it.
MarlinKimbra/temperature.cpp
View file @
c495ec3c
...
...
@@ -174,7 +174,7 @@ static unsigned char soft_pwm[HOTENDS];
static
int
minttemp_raw
[
HOTENDS
]
=
ARRAY_BY_HOTENDS
(
HEATER_0_RAW_LO_TEMP
,
HEATER_1_RAW_LO_TEMP
,
HEATER_2_RAW_LO_TEMP
,
HEATER_3_RAW_LO_TEMP
);
static
int
maxttemp_raw
[
HOTENDS
]
=
ARRAY_BY_HOTENDS
(
HEATER_0_RAW_HI_TEMP
,
HEATER_1_RAW_HI_TEMP
,
HEATER_2_RAW_HI_TEMP
,
HEATER_3_RAW_HI_TEMP
);
static
int
minttemp
[
HOTENDS
]
=
{
0
};
static
int
maxttemp
[
HOTENDS
]
=
ARRAY_BY_HOTENDS1
(
16383
);
static
int
maxttemp
[
HOTENDS
]
=
ARRAY_BY_HOTENDS1
(
16383
);
#if ENABLED(BED_MINTEMP)
static
int
bed_minttemp_raw
=
HEATER_BED_RAW_LO_TEMP
;
#endif
...
...
@@ -812,24 +812,7 @@ static float analog2temp(int raw, uint8_t e) {
return
celsius
;
}
switch
(
e
)
{
#if TEMP_SENSOR_BED
case
-
1
:
return
((
raw
*
((
5.0
*
100.0
)
/
1024.0
)
/
OVERSAMPLENR
)
*
TEMP_SENSOR_AD595_GAIN
)
+
TEMP_SENSOR_AD595_OFFSET
;
#endif
#if HEATER_0_USES_AD595
case
0
:
return
((
raw
*
((
5.0
*
100.0
)
/
1024.0
)
/
OVERSAMPLENR
)
*
TEMP_SENSOR_AD595_GAIN
)
+
TEMP_SENSOR_AD595_OFFSET
;
#endif
#if HEATER_1_USES_AD595
case
1
:
return
((
raw
*
((
5.0
*
100.0
)
/
1024.0
)
/
OVERSAMPLENR
)
*
TEMP_SENSOR_AD595_GAIN
)
+
TEMP_SENSOR_AD595_OFFSET
;
#endif
#if HEATER_2_USES_AD595
case
2
:
return
((
raw
*
((
5.0
*
100.0
)
/
1024.0
)
/
OVERSAMPLENR
)
*
TEMP_SENSOR_AD595_GAIN
)
+
TEMP_SENSOR_AD595_OFFSET
;
#endif
#if HEATER_3_USES_AD595
case
3
:
return
((
raw
*
((
5.0
*
100.0
)
/
1024.0
)
/
OVERSAMPLENR
)
*
TEMP_SENSOR_AD595_GAIN
)
+
TEMP_SENSOR_AD595_OFFSET
;
#endif
}
return
(
raw
*
((
5.0
*
100.0
)
/
1024.0
)
/
OVERSAMPLENR
);
return
((
raw
*
((
5.0
*
100.0
)
/
1023.0
)
/
OVERSAMPLENR
)
*
TEMP_SENSOR_AD595_GAIN
)
+
TEMP_SENSOR_AD595_OFFSET
;
}
// Derived from RepRap FiveD extruder::getTemperature()
...
...
@@ -854,7 +837,7 @@ static float analog2tempBed(int raw) {
return
celsius
;
#elif ENABLED(BED_USES_AD595)
return
((
raw
*
((
5.0
*
100.0
)
/
102
4
.0
)
/
OVERSAMPLENR
)
*
TEMP_SENSOR_AD595_GAIN
)
+
TEMP_SENSOR_AD595_OFFSET
;
return
((
raw
*
((
5.0
*
100.0
)
/
102
3
.0
)
/
OVERSAMPLENR
)
*
TEMP_SENSOR_AD595_GAIN
)
+
TEMP_SENSOR_AD595_OFFSET
;
#else
return
0
;
#endif
...
...
@@ -932,13 +915,13 @@ static void updateTemperaturesFromRawValues() {
#if HAS(POWER_CONSUMPTION_SENSOR)
// Convert raw Power Consumption to watt
float
raw_analog2voltage
()
{
return
(
5.0
*
current_raw_powconsumption
)
/
(
1023
*
OVERSAMPLENR
);
return
(
5.0
*
current_raw_powconsumption
)
/
(
1023
.0
*
OVERSAMPLENR
);
}
float
analog2voltage
()
{
float
power_zero_raw
=
(
POWER_ZERO
*
1023
*
OVERSAMPLENR
)
/
5.0
;
float
power_zero_raw
=
(
POWER_ZERO
*
1023
.0
*
OVERSAMPLENR
)
/
5.0
;
float
rel_raw_power
=
(
current_raw_powconsumption
<
power_zero_raw
)
?
(
2
*
power_zero_raw
-
current_raw_powconsumption
)
:
(
current_raw_powconsumption
);
return
((
5.0
*
rel_raw_power
)
/
(
1023
*
OVERSAMPLENR
))
-
POWER_ZERO
;
return
((
5.0
*
rel_raw_power
)
/
(
1023
.0
*
OVERSAMPLENR
))
-
POWER_ZERO
;
}
float
analog2current
()
{
float
temp
=
analog2voltage
()
/
POWER_SENSITIVITY
;
...
...
@@ -954,7 +937,7 @@ static void updateTemperaturesFromRawValues() {
if
(
temp1
<=
0
)
return
0.0
;
float
temp2
=
(
current
)
*
POWER_VOLTAGE
;
if
(
temp2
<=
0
)
return
0.0
;
return
((
temp2
/
temp1
)
-
1
)
*
100
;
return
((
temp2
/
temp1
)
-
1
)
*
100
;
}
float
analog2efficiency
(
float
watt
)
{
return
(
analog2current
()
*
POWER_VOLTAGE
*
100
)
/
watt
;
...
...
This diff is collapsed.
Click to expand it.
MarlinKimbra/thermistortables.h
View file @
c495ec3c
...
...
@@ -73,9 +73,9 @@ const short temptable_1[][2] PROGMEM = {
const
short
temptable_2
[][
2
]
PROGMEM
=
{
//200k ATC Semitec 204GT-2
//Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
// Calculated using 4.7kohm pullup,
voltage divider math,
and manufacturer provided temp/resistance
// Calculated using 4.7kohm pullup,
voltage divider math,
and manufacturer provided temp/resistance
{
1
*
OVERSAMPLENR
,
848
},
{
30
*
OVERSAMPLENR
,
300
},
//
top rating 300C
{
30
*
OVERSAMPLENR
,
300
},
//
top rating 300C
{
34
*
OVERSAMPLENR
,
290
},
{
39
*
OVERSAMPLENR
,
280
},
{
46
*
OVERSAMPLENR
,
270
},
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment