32 hours struggling no compile!

Hello I am Jason, new to arduino programing. Had printers with 2560 mega in past. I have a filament weld/splicer and reel machine I built. I outfitted an arduino nano,2- 5 volt psu, 5v double relay low trigger module, oled i2c .96 display, 100k ntc b3950 therm, 1 small fan and 2 40 watt carriage heaters. Project design is, place 2 ends filament into hinged heater body and applie heat to 190-220c dependant on type than switch to fan for cool down. 4min heat up 5 mins cool down. run stand alone gear motor to transfer reel to reel. Repeat. The repeat part happens by cycling pwr double through sw shutting arduino off gear motor on. vice versa. First part of sketch runs great ith 5 sec pwr on delay, than heat up and cooling together 11 mins per cycle. What doesn’t work is temp need to be set to <-67 c to get 190c out. Thermistor is definitely correct resistor/thermistor readings taken with fluke meter and thermo couple to second fluke to completely offline cycle unit. Fluke thermo meter provide 250 increments of temp rising ,volts rising ,ohms dropping. reading starting at 21.3 c thru 221.6c. I used the numbers the way tutorial instruction show and I get -c reading with reducing resistance readings. All 3 nano boards I own do it.

Also I can’t find a way to use the second relay pin in sketch. Adding it in anyway I know results in,error doesn’t name a type, or any of the other hundreds of errors I’ve seen. What’s a scope, I read the entire arduino tutorial–The whole thing, and it talked about it, but never shows and example. Also example of code for sketches your not using does nothing to help. Every sketch looks different to new eyes. Look I’m at the point I’ll pay for a fringin sketch just help and I’ll pay Up! I’m a machinist out my local nuclear power plant and not stupid by any means. I just don’t get it and this project is actually effecting my home life. I don’t quit, but I know when I’m beat. Help I’ll pay! I’m post sketch they only way it compiles, but without the functionality I mentioned. I probably won’t understand any explained. I need the line written and told where they go. Or better sketch complete with wire transfere of asking price. Sorry if I didn’t post things right.

splicerrealing2000.ino (3.08 KB)

We are struggling to open your file! Please, post your codes with code tags in the post-page.

You’re supposed to post like this:

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
const int relayPin = 8;
const int ThermistorPin = A0;
double Thermistor(int RawADC)
{
  double Temp;
  Temp = log(100000.0 * ((1023.0 / RawADC - 1)));
  Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp )) * Temp );
  Temp = Temp - 273.15;
  //Temp = (Temp * 9.0)/ 5.0 + 32.0;
  return Temp;
}


#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);


#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2


#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH  16
static const unsigned char PROGMEM logo16_glcd_bmp[] =
{
  B00000000, B11000000,
  B00000001, B11000000,
  B00000001, B11000000,
  B00000011, B11100000,
  B11110011, B11100000,
  B11111110, B11111000,
  B01111110, B11111111,
  B00110011, B10011111,
  B00011111, B11111100,
  B00001101, B01110000,
  B00011011, B10100000,
  B00111111, B11100000,
  B00111111, B11110000,
  B01111100, B11110000,
  B01110000, B01110000,
  B00000000, B00110000
};


#if (SSD1306_LCDHEIGHT != 64)
//#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif




void setup()
{
  Serial.begin(9600);
  pinMode(relayPin, OUTPUT);
}
// by default, we'll generate the high voltage from the 5v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)
// init done
// Show image buffer on the display hardware.


display.display();
//delay(2000);


display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(10, 0);
display.clearDisplay();
display.println("Filament Splicer / spooler 2000 ");


// invert the display
display.invertDisplay(true);
//delay(1000);
display.invertDisplay(false);
//delay(1000);
display.display();
//delay(2000);
display.clearDisplay();
}




void loop()
{
  int val;
  double temp;
  val = analogRead(ThermistorPin);
  temp = Thermistor(val);
  Serial.print("Temperature = ");
  Serial.print(temp);
  Serial.println(" C");
  if (temp >= 190)
  {
    digitalWrite(relayPin, LOW); // low level 5v 2 gang relay board = on
  }
  else
  {
    digitalWrite(relayPin, HIGH); // need only turn off not back on every other way won't compile!
    //tried adding a relay for fan on after heat from this rely off. won't compile,not named in scope.
    //whats a scope? I see setup,loop tems only. I read the intire arduino instruction, don't understand.
    //tried for days to include oled i2c display, won't compile. It's all greek to me!
    //Need oled to display temp readings like serial monitor. heat and fan relay info would be nice
    //but not required
  }
  delay(1000);
}
while (1)
{
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(10, 0);
  display.clearDisplay();
  display.println("Splicer Realing 2000:");
  printText();
  display.display();


}


}


void printText(void)
{
  String s;
  if (Serial.available())
  {
    s = Serial.readString();  //getting string input in variable "s"
    display.println(s);
    display.display();
    display.println("\n");
  }
  delay(4000);


}

sjason1377:
Hello I am Jason, new to arduino programing.

Welcome to the Forum.

Your Original Post rambles over a great number of different things. When you have a programming problem you should focus on one item at a time.

It sounds as if you have a program that works and then you made a change to it with the result that the changed program won't compile. If that is correct, post the program that works AND post the next version that does not compile AND post the error message that the compiler produces.

...R

PS ... I don't mind getting a program as an attachment but I believe people viewing the Forum on a tablet cannot open attachments.

There were two places where you used '/' to start a multi-line comment and never closed the comment with '/'. Changing those to '//' to make them single-line comments helped.

The #error message triggers. I had to comment it out to get further.

There are a lot of 'display' does not name a type" errors. That's because most of the setup() function was outside the function. Remove the extra '}'.

Just after the loop() function you have a 'while(1)' loop. That ha to be inside a function so I suspect loop() was ended prematurely. Take out the '}' above the 'while(1)'.

After those changes, at least it compiles.

Ok I am posting 2 files. Both are straight from copy paste online. If I try to combine them and a a fan or relay, it won’t work. The 2 won’t combine either. I have no knowledge about these things. I just need this machine working. I was horrible learning English in school. Luggage isn’t my strong suit. I build machines for a living. I built one for my wife’s 3d printing habit and now it’s an awesome paper weight

As far as the code tags go, They are as much a misery to me as this code. Nothing even close to instruction on what they do or how they work. You would receive much more compliance if they had instruction where people actually post. 30mins tiring to do that.

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2

#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH 16
static const unsigned char PROGMEM logo16_glcd_bmp =
{ B00000000, B11000000,
B00000001, B11000000,
B00000001, B11000000,
B00000011, B11100000,
B11110011, B11100000,
B11111110, B11111000,
B01111110, B11111111,
B00110011, B10011111,
B00011111, B11111100,
B00001101, B01110000,
B00011011, B10100000,
B00111111, B11100000,
B00111111, B11110000,
B01111100, B11110000,
B01110000, B01110000,
B00000000, B00110000
};

#if (SSD1306_LCDHEIGHT != 64)
#error(“Height incorrect, please fix Adafruit_SSD1306.h!”);
#endif

void setup() {
Serial.begin(9600);

// by default, we’ll generate the high voltage from the 5v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64)
// init done
// Show image buffer on the display hardware.

display.display();
//delay(2000);

display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(10, 0);
display.clearDisplay();
display.println("INPUT YOUR TEXT HERE: ");

// invert the display
display.invertDisplay(true);
//delay(1000);
display.invertDisplay(false);
//delay(1000);
display.display();
//delay(2000);
display.clearDisplay();
}

void loop() {
while (1) {
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(10, 0);
display.clearDisplay();
display.println(“input:”);
printText();
display.display();

}

}

void printText(void) {
String s;
if (Serial.available())
{
s = Serial.readString(); //getting string input in variable “s”
display.println(s);
display.display();
display.println("\n");
}
delay(4000);

}



//
#include <math.h>
/
/
const int relayPin = 8;
const int ThermistorPin = A0;
double Thermistor(int RawADC) {
double Temp;
Temp = log(10000.0*((1023.0/RawADC-1)));
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
Temp = Temp - 273.15;
Temp = (Temp * 9.0)/ 5.0 + 32.0;
return Temp;
}
/****************************************/
void setup() {
Serial.begin(9600);
pinMode(relayPin, OUTPUT);
}
void loop() {
int val;
double temp;
val=analogRead(ThermistorPin);
temp=Thermistor(val);
Serial.print(“Temperature = “);
Serial.print(temp);
Serial.println(” F”);
if (temp >= 81){
digitalWrite(relayPin, LOW);
}
else {
digitalWrite(relayPin, HIGH);
}
delay(1000);
}


#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
const int relayPin = 8;
const int FanPin = 3;
const int ThermistorPin = A0;
double Thermistor(int RawADC)
{
double Temp;
Temp = log(100000.0 * ((1023.0 / RawADC - 1)));
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp )) * Temp );
Temp = Temp - 273.15;
//Temp = (Temp * 9.0)/ 5.0 + 32.0;
return Temp;
}

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2

#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH 16
static const unsigned char PROGMEM logo16_glcd_bmp =
{
B00000000, B11000000,
B00000001, B11000000,
B00000001, B11000000,
B00000011, B11100000,
B11110011, B11100000,
B11111110, B11111000,
B01111110, B11111111,
B00110011, B10011111,
B00011111, B11111100,
B00001101, B01110000,
B00011011, B10100000,
B00111111, B11100000,
B00111111, B11110000,
B01111100, B11110000,
B01110000, B01110000,
B00000000, B00110000
};

#if (SSD1306_LCDHEIGHT != 64)
//#error(“Height incorrect, please fix Adafruit_SSD1306.h!”);
#endif

void setup()
{
Serial.begin(9600);

}
// by default, we’ll generate the high voltage from the 5v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64)
// init done
// Show image buffer on the display hardware.

display.display();
//delay(2000);

display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(10, 0);
display.clearDisplay();
display.println("Filament Splicer / spooler 2000 ");

// invert the display
display.invertDisplay(true);
//delay(1000);
display.invertDisplay(false);
//delay(1000);
display.display();
//delay(2000);
display.clearDisplay();
}
{
pinMode(relayPin, OUTPUT);
pinMode(fanPin, (OUTPUT);
}

void loop(){
while (1){
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(10, 0);
display.clearDisplay();
display.println(“Splicer Realing 2000:”);
printText();
display.display();

}

}

void printText(void)
{
String s;
if (Serial.available())
{
s = Serial.readString(); //getting string input in variable “s”
display.println(s);
display.display();
display.println("\n");
}
delay(4000);

}

int val;
double temp;
val = analogRead(ThermistorPin);
temp = Thermistor(val);
Serial.print(“Temperature = “);
Serial.print(temp);
Serial.println(” C”);
if (temp >= 190)
{
digitalWrite(relayPin_8 (HIGH);

digitalWrite(fanPin_3 (LOW);
{delay(240000);
}
else
{
digitalWrite(relayPin_8(HIGH);}

digitalWrite(FanPin_3 (HIGH);

}
delay(1000);
}

Please preview everything before posting it. The code tags do not appear correctly. All you have to do is click this button:

</>
and then paste the code in between the tags.

– DH

ok

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
const int relayPin = 8;
const int FanPin = 3;
const int ThermistorPin = A0;
double Thermistor(int RawADC)
{
  double Temp;
  Temp = log(100000.0 * ((1023.0 / RawADC - 1)));
  Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp )) * Temp );
  Temp = Temp - 273.15;
  //Temp = (Temp * 9.0)/ 5.0 + 32.0;
  return Temp;
}

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);


#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2


#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH  16
static const unsigned char PROGMEM logo16_glcd_bmp[] =
{
  B00000000, B11000000,
  B00000001, B11000000,
  B00000001, B11000000,
  B00000011, B11100000,
  B11110011, B11100000,
  B11111110, B11111000,
  B01111110, B11111111,
  B00110011, B10011111,
  B00011111, B11111100,
  B00001101, B01110000,
  B00011011, B10100000,
  B00111111, B11100000,
  B00111111, B11110000,
  B01111100, B11110000,
  B01110000, B01110000,
  B00000000, B00110000
};


#if (SSD1306_LCDHEIGHT != 64)
//#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif


void setup()
{
  Serial.begin(9600);
  
}
// by default, we'll generate the high voltage from the 5v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)
// init done
// Show image buffer on the display hardware.

display.display();
//delay(2000);

display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(10, 0);
display.clearDisplay();
display.println("Filament Splicer / spooler 2000 ");

// invert the display
display.invertDisplay(true);
//delay(1000);
display.invertDisplay(false);
//delay(1000);
display.display();
//delay(2000);
display.clearDisplay();
}
{
pinMode(relayPin, OUTPUT);
pinMode(fanPin, (OUTPUT);
}


void loop(){
  while (1){
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(10, 0);
  display.clearDisplay();
  display.println("Splicer Realing 2000:");
  printText();
  display.display();

  }

}

void printText(void)
{
  String s;
  if (Serial.available())
  {
    s = Serial.readString();  //getting string input in variable "s"
    display.println(s);
    display.display();
    display.println("\n");
  }
  delay(4000);

}

  int val;
  double temp;
  val = analogRead(ThermistorPin);
  temp = Thermistor(val);
  Serial.print("Temperature = ");
  Serial.print(temp);
  Serial.println(" C");
  if (temp >= 190)
  {
    digitalWrite(relayPin_8 (HIGH);  
  }
   digitalWrite(fanPin_3 (LOW);
  {delay(240000);
  } 
  else
  {
    digitalWrite(relayPin_8(HIGH);}
    {
    digitalWrite(FanPin_3 (HIGH); 
       
  }
  delay(1000);
}

You "close" setup() too soon.

Remember to also post error messages next time.

display doesn't name a type happens on every line the word display exist. If I // those lines another 22 different errors are found. It's just not going to happen for me. apparently I can't even get it done through paying for it to be written. I offered!

DH12043:
The code tags do not appear correctly. All you have to do is click this button:

</>
and then paste the code in between the tags.

– DH

An alternative is to go to the IDE file/edit/copy for forum then simply paste into your post - code tags added automatically. Also, do a ctrl-t on the sketch before you copy. This will format the code for easier reading/debugging.

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
const int relayPin = 8;
const int FanPin = 3;
const int ThermistorPin = A0;
double Thermistor(int RawADC)
{
  double Temp;
  Temp = log(100000.0 * ((1023.0 / RawADC - 1)));
  Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp )) * Temp );
  Temp = Temp - 273.15;
  //Temp = (Temp * 9.0)/ 5.0 + 32.0;
  return Temp;
}

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);


#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2


#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH  16
static const unsigned char PROGMEM logo16_glcd_bmp[] =
{
  B00000000, B11000000,
  B00000001, B11000000,
  B00000001, B11000000,
  B00000011, B11100000,
  B11110011, B11100000,
  B11111110, B11111000,
  B01111110, B11111111,
  B00110011, B10011111,
  B00011111, B11111100,
  B00001101, B01110000,
  B00011011, B10100000,
  B00111111, B11100000,
  B00111111, B11110000,
  B01111100, B11110000,
  B01110000, B01110000,
  B00000000, B00110000
};


#if (SSD1306_LCDHEIGHT != 64)
//#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif


void setup()
{
  Serial.begin(9600);
  
}
// by default, we'll generate the high voltage from the 5v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)
// init done
// Show image buffer on the display hardware.

display.display();
//delay(2000);

display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(10, 0);
display.clearDisplay();
display.println("Filament Splicer / spooler 2000 ");

// invert the display
display.invertDisplay(true);
//delay(1000);
display.invertDisplay(false);
//delay(1000);
display.display();
//delay(2000);
display.clearDisplay();
}
{
pinMode(relayPin, OUTPUT);
pinMode(fanPin, (OUTPUT);
}



  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(10, 0);
  display.clearDisplay();
  display.println("Splicer Realing 2000:");
  printText();
  display.display();

  }

}

void printText(void)
{
  String s;
  if (Serial.available())
  {
    s = Serial.readString();  //getting string input in variable "s"
    display.println(s);
    display.display();
    display.println("\n");
  }
  delay(4000);

}


void loop(){
  while (1){
  int val;
  double temp;
  val = analogRead(ThermistorPin);
  temp = Thermistor(val);
  Serial.print("Temperature = ");
  Serial.print(temp);
  Serial.println(" C");
  if (temp >= 190)
  {
    digitalWrite(relayPin_8 (HIGH);  
  }
   digitalWrite(fanPin_3 (LOW);
  {delay(240000);
  } 
  else
  {
    digitalWrite(relayPin_8(HIGH);}
    {
    digitalWrite(FanPin_3 (HIGH); 
       
  }
  delay(1000);
}

Here’s my fix:

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
const int relayPin = 8;
const int FanPin = 3;
const int ThermistorPin = A0;
double Thermistor(int RawADC)
{
  double Temp;
  Temp = log(100000.0 * ((1023.0 / RawADC - 1)));
  Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp )) * Temp );
  Temp = Temp - 273.15;
  //Temp = (Temp * 9.0)/ 5.0 + 32.0;
  return Temp;
}

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);


#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2


#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH  16
static const unsigned char PROGMEM logo16_glcd_bmp[] =
{
  B00000000, B11000000,
  B00000001, B11000000,
  B00000001, B11000000,
  B00000011, B11100000,
  B11110011, B11100000,
  B11111110, B11111000,
  B01111110, B11111111,
  B00110011, B10011111,
  B00011111, B11111100,
  B00001101, B01110000,
  B00011011, B10100000,
  B00111111, B11100000,
  B00111111, B11110000,
  B01111100, B11110000,
  B01110000, B01110000,
  B00000000, B00110000
};


#if (SSD1306_LCDHEIGHT != 64)
//#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif


void setup()
{
  Serial.begin(9600);


  // by default, we'll generate the high voltage from the 5v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)
  // init done
  // Show image buffer on the display hardware.

  display.display();
  //delay(2000);

  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(10, 0);
  display.clearDisplay();
  display.println("Filament Splicer / spooler 2000 ");

  // invert the display
  display.invertDisplay(true);
  //delay(1000);
  display.invertDisplay(false);
  //delay(1000);
  display.display();
  //delay(2000);
  display.clearDisplay();

  pinMode(relayPin, OUTPUT);
  pinMode(fanPin, (OUTPUT);
}


void loop() {
  while (1) {
    display.setTextSize(1);
    display.setTextColor(WHITE);
    display.setCursor(10, 0);
    display.clearDisplay();
    display.println("Splicer Realing 2000:");
    printText();
    display.display();

  }

}

void printText(void)
{
  String s;
  if (Serial.available())
  {
    s = Serial.readString();  //getting string input in variable "s"
    display.println(s);
    display.display();
    display.println("\n");
  }
  delay(4000);
}

void foo() {
  int val;
  double temp;
  val = analogRead(ThermistorPin);
  temp = Thermistor(val);
  Serial.print("Temperature = ");
  Serial.print(temp);
  Serial.println(" C");
  if (temp >= 190)
  {
    digitalWrite(relayPin_8 (HIGH);
  }
  digitalWrite(fanPin_3 (LOW);
  { delay(240000);
  }
  else
  {
    digitalWrite(relayPin_8(HIGH);
  }
  {
    digitalWrite(FanPin_3 (HIGH);

  }
  delay(1000);
}

I moved the thermistor stuff into a separate function. It’s clear that the OP has simply tried to mash two sketches together: one to read strings from the serial and print them on an LCD, and one to operate a printer fan. Delays everywhere, including an unconditional four-minute delay in the temperature control routine.

As Monty Python said: “Well, we’ve got all the words there. All we need to do is to put them in the right order.” It’s not an approach that actually works. Imagine that you wanted to build a car engine. Would you start by getting two engines, randomly bolting bits of them together into one … thing … and then expect it to just go like you imagine?

Jason, you don’t really know what you are doing. And the fact that it took you until post#7 to work out how to correctly post code in this forum is a bit of a symptom. You just want things to work, and you are going about it by just doing the first thing you think of. Trial and error is all very well, but it kinda fails when you try to do something complex, because the problem space is too big to explore by just blindly thrashing about until you get somewhere.

Either pay someone to write some code, or:

  • put your 3d printer aside
  • read the learning arduino pages on this site
  • review the tutorial sketches in the IDE, and actually build the projects
  • do a C++ tutorial - google to find a free one, there are jillions of them
  • write your 3d printer sketch by first working out what you actually want it to do, then writing the code that does it.

Yeah for all your intelligence you lack the understanding that the purpose of my post was actually an offering for payment for that very thing. I'm not interesting in this programming stuff. I built something dependent upon it. There is no outlet for me to pay someone, because no one has taking my offer. most people do this as hobby, other require it. There is a difference. I will never again use an adruino product and looks like this machine is getting trashed. Thanks for all your criticism, for ignoring my (offers) for payment and for doing the one thing forums do so well. Making normal people feel small. No wonder the net is filled with so many people that where treated like outcast and made to feel stupid here.

sjason1377:
Yeah for all your intelligence you lack the understanding that the purpose of my post was actually an offering for payment for that very thing.

Then why don't you post it in the proper place: Gigs and Collaborations

Although, with such a bad attitude, I'm not sure I'd be interested in working for you.

sjason1377:
Yeah for all your intelligence you lack the understanding that the purpose of my post was actually an offering for payment for that very thing. I'm not interesting in this programming stuff.

Then you should ask in the Gigs and Collaboration section of the Forum.

This part of the Forum is for helping people write their own code.

...R

PS. ,,, being abusive to people who are trying to help is generally a bad strategy.

Thank-you for the help with my machine! Sorry I was a bit short and misunderstanding. Im really trying here.

Ok I Think I have a major improvement to my sketch with 1 remaining problem. It compiles, relay turns heater on and back off. Fan comes on and shuts off after 240,000 4 mins cool down than back off. I use double high logic to physically end loop. I works even if it’s wrong. However regardless of what I try oled doesn’t display serial data requested. I need temp reading on the oled. I have println and print line where I can write text that does display on this little screen, but not the data collected from A0 therm readings. Also serial monitor no-longer show temp readings. I would think that would indicate transfer of that resource. If that is the case, where is the serial data being sent. It’s definitely not on the oled which is displaying text written in this sketch. I // out the written text to free up display to only the expect function. No improvement. Other users have little trouble outputting serial data with this same scheme using DTH sensor and many other with thermistors using much more function added to there sketch. Mine is identical to many I see excluding turning on lighting, running pumps etc. It’s something not connecting the println serial and display commands. There doesn’t seem to be any direct library or function to display serial data based on generic use of analog readings that can be file added or sketch copy pasted. There needs to be. It’s just not safe using an offline machine with 300C temp ability with feed back info for the user. 3d printers use arduino and output so much more than I’m requesting.

[code]


#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
const int relayPin = 8;
const int fanPin = 3;
const int ThermistorPin = A0;
double Thermistor(int RawADC)
{
  double Temp;
  Temp = log(100000.0 * ((1023.0 / RawADC - 1)));
  Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp )) * Temp );
  Temp = Temp - 273.15;
  //Temp = (Temp * 9.0)/ 5.0 + 32.0;
  return Temp;
}

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);


#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2


#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH  16
static const unsigned char PROGMEM logo16_glcd_bmp[] =
{
  B00000000, B11000000,
  B00000001, B11000000,
  B00000001, B11000000,
  B00000011, B11100000,
  B11110011, B11100000,
  B11111110, B11111000,
  B01111110, B11111111,
  B00110011, B10011111,
  B00011111, B11111100,
  B00001101, B01110000,
  B00011011, B10100000,
  B00111111, B11100000,
  B00111111, B11110000,
  B01111100, B11110000,
  B01110000, B01110000,
  B00000000, B00110000
};


#if (SSD1306_LCDHEIGHT != 64)
//#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif


void setup()
{
  Serial.begin(9600);


  // by default, we'll generate the high voltage from the 5v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)
  // init done
  // Show image buffer on the display hardware.

  display.display();
  //delay(2000);

  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(10, 0);
  display.clearDisplay();
  //display.println("Filament Splicer / spooler 2000 ");

  // invert the display
  display.invertDisplay(true);
  //delay(1000);
  display.invertDisplay(false);
  //delay(1000);
  display.display();
  //delay(2000);
  display.clearDisplay();

  pinMode(relayPin, OUTPUT);
  pinMode(fanPin, OUTPUT);
}


void loop() {
  while (1) {
    display.setTextSize(1);
    display.setTextColor(WHITE);
    display.setCursor(10, 0);
    display.clearDisplay();
    //display.println("Splicer Realing 2000:");
    printText();
    display.display();

  }

}

void printText(void)
{
  String s;
  if (Serial.available())
  {
    s = Serial.readString();  //getting string input in variable "s"
    display.println(s);
    display.display();
    display.println("\n");
  }
  delay(4000);
}

void foo() {
  int val;
  double temp;
  val = analogRead(ThermistorPin);
  temp = Thermistor(val);
  Serial.print("Temperature = ");
  Serial.print(temp);
  Serial.println(" C");
  Serial.readString();  //getting string input in variable "s"
  display.println();  
     
  if (temp >= 190){
    digitalWrite(relayPin, HIGH);
    digitalWrite(fanPin, LOW);
  }
  else {
    digitalWrite(relayPin, HIGH);
  }
  {
  delay(240000);
  }   
    digitalWrite(fanPin, HIGH);
{
  }
  delay(1000); 
}

[/code]

Should string s; be (String s "xyz")

To start with it's impossible to make sense of your huge single-paragraph text. Use white space to break up the different ideas and allow the reader time to draw breath - like this

Ok I Think I have a major improvement to my sketch with 1 remaining problem.

It compiles, relay turns heater on and back off. Fan comes on and shuts off after 240,000 4 mins cool down than back off. I use double high logic to physically end loop. I works even if it's wrong.

However regardless of what I try oled doesn't display serial data requested.

I need temp reading on the oled. I have println and print line where I can write text that does display on this little screen, but not the data collected from A0 therm readings.

Also serial monitor no-longer show temp readings. I would think that would indicate transfer of that resource.

If that is the case, where is the serial data being sent. It's definitely not on the oled which is displaying text written in this sketch.

I // out the written text to free up display to only the expect function. No improvement.

Other users have little trouble outputting serial data with this same scheme using DTH sensor and many other with thermistors using much more function added to there sketch.

Mine is identical to many I see excluding turning on lighting, running pumps etc.

It's something not connecting the println serial and display commands. There doesn't seem to be any direct library or function to display serial data based on generic use of analog readings that can be file added or sketch copy pasted. There needs to be.

It's just not safe using an offline machine with 300C temp ability with feed back info for the user. 3d printers use arduino and output so much more than I'm requesting.

...R

Now that I have re-formatted your text for easier reading I can see parts that I can understand and parts that I can’t understand.

And, overall, it reinforces what I said in Reply #3 - IMHO you are not focusing sharply enough on a single issue. Or maybe you are thinking of a wide-ranging problem when you should be thinking of a small (in scope) problem.

Keep in mind that I am not familiar with the details of writing to your OLED display.

  • Are you able to write code that will show “Hello World” on the display?
  • If you have a variable called (say) myTemperature which has a value of 25 are you able to show that on the display?

…R