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);
}