Circuit diagram
3Dsimo Kit
Device: 3Dsimo Kit
Rev. 1.00 Page 11/18
* create timer for main loop
*/
EveryTimer timer;
/*
* function for measuring temperature of the tip
*/
int getTemperature (){ // get temperature in deg. Celsius from ADU value
// set reference for ADC to power supply (5V)
analogReference (DEFAULT);
int avgTemp = 0 ;
for ( int i = 0 ; i< 16 ; i++){
avgTemp += analogRead (TEMP_IN);
}
// read averaged analog value of temperature
long tempADU = avgTemp >> 4 ;
// convert ADU into temperature
// constants could slightly change for different ceramic tip
tempADU -= 1692 ; // increase this value when temperature is too high and vice versa
tempADU <<= 7 ;
tempADU /= (- 557 );
return tempADU;
}
/*
* load actual material profile
*/
void loadMaterial ( int id){
profile_t profile;
char text[ 10 ];
// load material profile from PROGMEM and assign variables
memcpy_P (&profile, &materials[id], sizeof ( profile_t ));
setTemperature = profile.temperature;
setMotorSpeed = profile.motorSpeed;
// clear display and show all information
sprintf (text, "%d %%", setMotorSpeed);
ssd1306_clearScreen ();
ssd1306_setFixedFont (ssd1306xled_font6x8);
ssd1306_printFixedN ( 0 , 0 , profile.materialName, STYLE_NORMAL, FONT_SIZE_2X);
ssd1306_printFixedN ( 80 , 0 , text, STYLE_NORMAL, FONT_SIZE_2X);
}










