Sei sulla pagina 1di 6

The Flow (charot)

For DRY BUTTON,


(in program)

1. Set timer
2. Set temperature
3. Send to Arduino the timer and the temperature set.
4. Ang mag on lang sa hardware kay ang filaments, temperature sensor
and fan.
5. Display the Temperature being set (not the real-time but the desired)

6.a Display the countdown timer.


6.b Cancel operation

7. When time’s up, display done. Turn off the machine.

FOR MILL BUTTON,


1. Set Milling duration.
2. Send to Arduino
3. Turn on miller, turn on flipper
4.a Display the countdown timer.
4.b Cancel operation
5. When time’s up, display done. Turn off the machine.

FOR DRY & MILL BUTTON,


1. Set timer and temperature for drying.
2. Set timer for miller.
3. Send to Arduino.
4. Ang mag on lang sa hardware kay ang filaments, temperature sensor
and fan.
5. Display the temperature desired and then the countdown timer for
drying.
6. After drying time, off ang drying stuff then on ang miller then flipper.
7. Display the countdown of milling time.
8. After milling time, turn off the miller.
double_dht22.ino
Current Arduino Program PAHELP PO
#include <RelayModule.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>

#define DHTTYPE DHT22


#define FAN 3 // FAN
#define FILAMENT1 5
#define RVR 8 //CW is defined as pin #7// flipper
#define FWD 7 //CCW is defined as pin #8// flipper
#define DHTPIN1 9 //FIRST TEMPERATURE SENSOR
#define DHTPIN2 10 //SECOND TEMPERATURE SENSOR
#define MILLER 11

DHT dht1 (DHTPIN1, DHTTYPE, 15);


DHT dht2 (DHTPIN2, DHTTYPE, 15);

void REVERSE (){


digitalWrite(RVR,HIGH); //Motor runs clockwise//
delay(250); //250 //for 1 second//
digitalWrite(RVR,LOW);
}
void FORWARD (){
digitalWrite(FWD,HIGH); //Motor runs clockwise//
delay(260); //240 //for 1 second//
digitalWrite(FWD,LOW);
}
void MILL () {
digitalWrite(MILLER,HIGH);
delay(10000000000000);
digitalWrite(MILLER, LOW);
}

void setup() {

Serial.begin(9600);

dht1.begin();
dht2.begin();

pinMode(FAN, OUTPUT);
pinMode(RVR, OUTPUT); //Set CW as an output//
pinMode(FWD, OUTPUT); //Set CCW as an output//
pinMode(MILLER, OUTPUT);
pinMode(FILAMENT1, OUTPUT);

digitalWrite(FILAMENT1,LOW); //TURN OFF FILAMENT1


digitalWrite(FAN,LOW); //TURN OFF FAN
digitalWrite(MILLER,LOW); //TURN OFF MILLER
digitalWrite(RVR,LOW);
digitalWrite(FWD,LOW);

}
void loop() {

digitalWrite(FILAMENT1,HIGH); //TURN ON FILAMENT1


digitalWrite(FAN, HIGH);
float temp1 = dht1.readTemperature();
float temp2 = dht2.readTemperature();
float minutes =( millis() / 1000/60 ); //TIMER
float total = temp1 + temp2;
float average = total / 2;
Serial.print("Temp: ");
Serial.println(temp1);
delay(1000);

Serial.print("Time: ");
Serial.println(minutes);
delay(1000);

if (temp1 == 40 || temp1> 40)


{
digitalWrite(FAN, HIGH);
}
if (temp1 == 35 || temp1> 35)
{
digitalWrite(FAN, LOW);
}

if (minutes == 5)
{

digitalWrite(FILAMENT1,LOW); //TURN OFF FILAMENT1


digitalWrite(FAN, LOW);
FORWARD();
delay(2000);
REVERSE();
delay(2000);
FORWARD();
delay(2000);
REVERSE();

}
}

Potrebbero piacerti anche