hello
have an issue where i can not get pin 8 or 12 to switch a led (in turn a relay) on for testing
have tried to change/swap other pins and it worked so why will pin 8 or 12 work?
please help
/*still Control Trial
the object is to monitor temp at three points and to have set points that switchs on water pump (cooling Water)
and the then turn on a fan to the keep the cooling water at a even level*/
#include <OneWire.h> //This temperature sensor requires a 4.7k Ohm resistor
#include <DallasTemperature.h>
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h> // F Malpartida's NewLiquidCrystal library
#define I2C_ADDR 0x27 // Define I2C Address where the PCF8574A is
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
int n = 1;
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
float currentTemp = 0;
int LEDone = 4; // indicator for Pump On
int SSRwaterpumpPin = 5; // Turn on water pump
//int SSRHeaterPin = 6; // Turn on heat (electric or gas)
int SSRraditatorFan = 7; // To turn on and off the air radiator fan
int LEDtwo = 8; // indicator for Fan On
//This temperature sensor requires a 4.7k Ohm resistor
// Data wire is plugged into pin 3 on the Arduino
#define ONE_WIRE_BUS 3
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
DeviceAddress boilermid = {
0x28, 0xFF, 0xC8, 0x58, 0x2D, 0x04, 0x00, 0x2F };
DeviceAddress boilerbottom = {
0x28, 0xFF, 0x99, 0x1B, 0x44, 0x04, 0x00, 0x34 };
DeviceAddress cooling = {
0x28, 0xFF, 0x2F, 0x20, 0x44, 0x04, 0x00, 0x3B };
void setup(void)
{
lcd.begin (20,4);
// Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);
lcd.home (); // go home
//lcd.clear(); // clear LCD
lcd.setCursor(0,0); // set cursor to column 1, row 1
// 012345678901234567890
lcd.print(" CAVEMAN DISTILLERY"); //SPLASH
lcd.setCursor(0,1); //SCREEN
// 012345678901234567890
lcd.print("********************");
delay(5000); // delay for dramatic effect!
lcd.clear(); // clear lcd
// Start up the library
sensors.begin();
// set the resolution to 12 bit (fast?)
sensors.setResolution(boilermid, 12);
sensors.setResolution(boilerbottom, 12);
sensors.setResolution(cooling, 12);
//pinMode(SSRHeaterPin, OUTPUT);
//digitalWrite(SSRHeaterPin, LOW);
pinMode(SSRraditatorFan, OUTPUT); //set raditator fan pin as output
digitalWrite(SSRraditatorFan, LOW);
pinMode(SSRwaterpumpPin, OUTPUT);
digitalWrite(SSRwaterpumpPin, LOW);
pinMode(LEDone, OUTPUT);
digitalWrite(LEDone, LOW);
pinMode(LEDtwo, OUTPUT);
digitalWrite(LEDtwo, LOW);
}
void printTemperature(DeviceAddress deviceAddress)
{
sensors.requestTemperatures(); // was in loop
float tempC = sensors.getTempC(deviceAddress);
if (tempC == -127.00) {
lcd.print("Error");
}
else {
// lcd.print(tempC);
// lcd.print("/");
currentTemp = (DallasTemperature::toFahrenheit(tempC));
lcd.print(currentTemp,DEC);
}
}
void loop(void)
{
delay(500);
sensors.requestTemperatures();
float boilermid = sensors.getTempCByIndex(0);
lcd.setCursor(0, 0);
lcd.print("Boiler Middle:");
lcd.print(sensors.getTempCByIndex(0));
lcd.print((char)223); // print degree symbol
float boilerbottom = sensors.getTempCByIndex(1);
lcd.setCursor(0, 1);
lcd.print("Boiler Bottom:");
lcd.print(sensors.getTempCByIndex(1));
lcd.print((char)223); // print degree symbol
float cooling = sensors.getTempCByIndex(2);
lcd.setCursor(0, 2);
lcd.print("Cooling Water:");
lcd.print(sensors.getTempCByIndex(2));
lcd.print((char)223); // print degree symbol
//Cooling Mode
if (boilerbottom >=30)
{
//digitalWrite(SSRHeaterPin, LOW);
digitalWrite(SSRwaterpumpPin, HIGH);//pin 5
digitalWrite(LEDone, HIGH); //Pump led pin 4
}
else if (boilerbottom <=29)
{
//digitalWrite(SSRHeaterPin, LOW);
digitalWrite(SSRwaterpumpPin, LOW);//pin 5
digitalWrite(LEDone, LOW); //Pump led pin 4
}
if (cooling >=25)
{
//digitalWrite(SSRHeaterPin, LOW);
digitalWrite(SSRraditatorFan, HIGH);//pin 7
digitalWrite(LEDtwo, HIGH);//Fan led pin 8
}
else if (cooling <=24)
//digitalWrite(SSRHeaterPin, LOW);
digitalWrite(SSRraditatorFan, LOW);//pin 7
digitalWrite(LEDtwo, LOW);//Fan led pin 8
}
[code]
[/code]