aquarium controller probleem

Projecten die niet passen in bovenstaande onderwerpen
Berichten: 91
Geregistreerd: 23 Okt 2013, 05:50

aquarium controller probleem

Berichtdoor pedro koi » 30 Nov 2016, 19:12

Hallo onlangs een setje arduino mega 2560 r3 met bijpassen touch en scherm gekocht op saint smart.
na aankomst wat testjes gedaan omdat ik vorig jaar ook al zo setje had van ebay maar toen werkte scherm niet correct en hingen nieuw Versturen maar nooit aangekomen dus nu save gespeeld en alles in 1 keer bij 1 leverancier gekocht.

Wil dus graag een aquarium controller hebben en bouwen had al een sketch gemaakt voor men temp uit te lezen en eentje voor de rtc klok deze 2 werkten perfect op men schield.

Na wat zoek werk ben ik uitgekomen op een controller die al gemaakt is dus waarom wiel 2 maal uitvinden is net wat ik wou.

Nadat ik de sketch had gedowload en geinstaleerd eens gecompileerd al snel kwamen fout meldingen.

nu had ik eerst de.
Code: Alles selecteren
#include.utouch.h veranderd in men eigen code van men schield #URTouch.h en samen met deze regel ook aangepâst URTouch  myTouch( 6, 5, 4, 3, 2);


ook de
Code: Alles selecteren
#include <UTFT.h>  en de regel UTFT myGLCD(SSD1289,38,39,40,41); 
aangepast was andere libery.

nadat ik deze heb aangepast terug compiler gedaan.

toen kreeg ik de foutmelding.
Code: Alles selecteren
FirstQuarter.c:9:1: error: unknown type name 'prog_uint16_t'
prog_uint16_t FirstQuarter[0x9C4] PROGMEM ={


nadat ik heb opgezocht hoe dit op te lossen moest ik de regel
Code: Alles selecteren
 prog_uint16 veranderen in const_uint16


tevens moest ik men c file aanpassen naar in plaats van
Code: Alles selecteren
.c als ext naar .cpp


nadat ik dit deed kreeg ik fout code.
Code: Alles selecteren
 const_uint16_t FirstQuarter[0x9C4] PROGMEM ={

 ^

exit status 1
'const_uint16_t' does not name a type



Wie kan me helpen het topic erover loopt op engelse forum maar men engels is niet zo goed om daar vragen te kunnen stellen.

http://forum.arduino.cc/index.php?topic=54196.0

Advertisement

Gebruikers-avatar
Berichten: 2655
Geregistreerd: 06 Aug 2016, 01:03

Re: aquarium controller probleem

Berichtdoor Koepel » 30 Nov 2016, 19:18

De "const" is een keyword en de "uint16_t" is een keyword. Dus los van elkaar.

Berichten: 91
Geregistreerd: 23 Okt 2013, 05:50

Re: aquarium controller probleem

Berichtdoor pedro koi » 30 Nov 2016, 19:30

Koepel schreef:De "const" is een keyword en de "uint16_t" is een keyword. Dus los van elkaar.


merci om mee te denken.
Code: Alles selecteren
const _uint16_t FirstQuarter[0x9C4] PROGMEM ={


nu komt const in het blauw te staan als er een spatie tussen staat zonder spatie juist de underscore was het eerst.
fout blijft zelfde?

Berichten: 91
Geregistreerd: 23 Okt 2013, 05:50

Re: aquarium controller probleem

Berichtdoor pedro koi » 30 Nov 2016, 20:02

zelf wat gezocht nog bleek de under score weg moet nu krijg ik andere problemen
Code: Alles selecteren
const uint16_t FirstQuarter[0x9C4] PROGMEM ={

Berichten: 91
Geregistreerd: 23 Okt 2013, 05:50

Re: aquarium controller probleem

Berichtdoor pedro koi » 02 Dec 2016, 12:12

door de vele fout meldingen en ik eigenlijk niet weet waar zoeken om het op te lossen ben ik begonnen om zelfs iets te schrijven.
inmidddels vele sketchen geprobeerd wat nu al lukt .
das men 3 wire sensors op men lcd te laten verschijnen dus de temp lukt al.
wat ik nu nog bij wil das een time functie, dag en uur op men lcd scherm. daarvoor ha ik gebruik maken van men ds3231 clock print.
na vele testen terug met verschillende libary van de print eentje gevonden die een test compileerd en in serial monitor afprint.
na deze te hebben gevonden heb ik men aquarium sketch naast deze gelegd en beginnen aanvullen moest dus een rtc lib en wire libe toevoegen, dit lukt geen probleem ook stukje code bij gevoegd in void setup en void loop de sketch compileerd naar men bord .
nu komt op de plaats waar het jaar zou moeten verschijnen een resem vreemde uitprint van rechts naar links terwijl ik enkel de datum wil printen op men lcd. wie weet waar het verkeerd gaat de bedoeling is dus enkel dag in tekst en uur klok erbij op de lcd .

Code: Alles selecteren
#include <SPI.h>

//libraries for lcd screen
#include <UTFT.h>  //

// Libraries for DS1820 and Onewire
#include <OneWire.h>
#include <DallasTemperature.h>

//libraries for the ds3231 clock
#include <Wire.h>
#include "RTClib.h"


extern uint8_t BigFont[];

#define ONE_WIRE_BUS 13
float probe01;
float probe02;
float probe03;


OneWire oneWire(ONE_WIRE_BUS); // Setup onewire instance to communicate with devices.Uno 2 imposible other
DallasTemperature sensors(&oneWire);


// create an instance of the library
UTFT myGLCD(SSD1289, 38, 39, 40, 41); // start up an instance of the TFT screen

// char array to print to the screen
char sensorPrintout[10];  //For print out full numbers of dallas ds18b20 0*28, 0*60, 0*E5, 0*4C, 0*05, 0*00, 0*00, 0*12
char sensorPrintout1[10];
char sensorPrintout2[10];//For print out full numbers of dallas ds18b20 0*28, 0*D0, 0*63, 0*4D, 0*05, 0*00, 0*00, 0*CD

RTC_DS3231 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup()
{
  myGLCD.InitLCD();        // <= Dont need LANDSCAPE since is default
  myGLCD.clrScr();         // <= Clear writepage 1
  myGLCD.setFont(BigFont);
 

 
sensors.begin();
Serial.begin(9600);

delay(750); // wait for console opening

  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }

  if (rtc.lostPower()) {
    Serial.println("RTC lost power, lets set the time!");
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  }


}


void loop()
{
 gettemp(); // Read the temperature.
 String probe01 = String(sensors.getTempCByIndex(0));
 probe01.toCharArray(sensorPrintout, 5);
 String probe02 = String(sensors.getTempCByIndex(1));
 probe02.toCharArray(sensorPrintout1, 5);
 

DateTime now= rtc.now();

 //kiezen kleur tekst en achtergrond lcd scherm
 
 myGLCD.setColor(0, 255, 0);//kleur lettertype
 
 

 
 //print tekst op lcd scherm
 
 myGLCD.print("pedro schrimp tank", 15, 5);

 
 
 //print klok op lcd scherm
 myGLCD.print(now.year(), 15,10);


 
 
 //print temperatuur op lcd scherm
 
 myGLCD.print("Aquarium:", 15, 40);
 myGLCD.print(sensorPrintout,165,40);
 myGLCD.print("c",250,40);
 myGLCD.print("Room:",15, 75);
 myGLCD.print(sensorPrintout1,165,75);
 myGLCD.print("c",250,75);
 myGLCD.print("Led's:",15, 110);
 myGLCD.print(sensorPrintout2,165,110);
 myGLCD.print("c",250,110);
 

}

void gettemp() // call sensors.requestTemperatures() to issue
               // a global temp request to all devices on the bus.
{
 sensors.requestTemperatures(); // Send the command to get temperatures.
 probe01 = (sensors.getTempCByIndex(0));
 probe02 = (sensors.getTempCByIndex(1));
 probe03= (sensors.getTempCByIndex(2));

 delay(750);
}

Berichten: 91
Geregistreerd: 23 Okt 2013, 05:50

Re: aquarium controller probleem

Berichtdoor pedro koi » 02 Dec 2016, 13:12

heb het werkend gekregen si dit is wat ik wou das men basis op dit ha ik verder gaan wil nog barometer toevoegen en dan nog wat functie's om relais te sturen

Code: Alles selecteren
//libraries for lcd screen
#include <UTFT.h>  //

// Libraries for DS1820 and Onewire
#include <OneWire.h>
#include <DallasTemperature.h>

//libraries for the ds3231 clock

#include "RTClib.h"
#include <Wire.h>


extern uint8_t SmallFont[];
extern uint8_t BigFont[];
RTC_DS1307 RTC;
#define ONE_WIRE_BUS 13
float probe01;
float probe02;
float probe03;


OneWire oneWire(ONE_WIRE_BUS); // Setup onewire instance to communicate with devices.Uno 2 imposible other
DallasTemperature sensors(&oneWire);


// create an instance of the library
UTFT myGLCD(SSD1289, 38, 39, 40, 41); // start up an instance of the TFT screen

// char array to print to the screen
char sensorPrintout[10];  //For print out full numbers of dallas ds18b20 0*28, 0*60, 0*E5, 0*4C, 0*05, 0*00, 0*00, 0*12
char sensorPrintout1[10];
char sensorPrintout2[10];//For print out full numbers of dallas ds18b20 0*28, 0*D0, 0*63, 0*4D, 0*05, 0*00, 0*00, 0*CD


void setup()
{
   myGLCD.InitLCD();
  myGLCD.clrScr();
  myGLCD.setColor(0, 255, 255);
  // Start up the library
  sensors.begin();
  Serial.begin(9600);
  Wire.begin();
  RTC.begin();
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
   // RTC.adjust(DateTime(__DATE__, __TIME__));
  }
}

void loop()
{

 DateTime now = RTC.now();
 gettemp(); // Read the temperature.
 String probe01 = String(sensors.getTempCByIndex(0));
 probe01.toCharArray(sensorPrintout, 5);
 String probe02 = String(sensors.getTempCByIndex(1));
 probe02.toCharArray(sensorPrintout1, 5);
 String probe03 = String(sensors.getTempCByIndex(2));
 probe03.toCharArray(sensorPrintout2, 5);


 
 //kiezen kleur tekst en achtergrond lcd scherm
 
 myGLCD.setColor(0, 255, 0);//kleur lettertype
 myGLCD.setFont(SmallFont);
 
//print tekst op lcd scherm
 
 myGLCD.print("pedro schrimp tank", 100, 5);
 myGLCD.setFont(BigFont);
 //print klok op lcd scherm
 
 myGLCD.printNumI(now.year(), 200, 20);
 myGLCD.print("/", 170, 20);
 myGLCD.printNumI(now.month(), 120, 20);
 myGLCD.print("/", 90, 20);
 myGLCD.printNumI(now.day(), 60, 20);
 
 myGLCD.printNumI(now.hour(), 100, 35);
 myGLCD.print(":", 160, 35);
 myGLCD.printNumI(now.minute(), 200, 35);
 
 
 
 //print temperatuur op lcd scherm
 
 myGLCD.print("Aquarium:", 15, 145);
 myGLCD.print(sensorPrintout,165,145);
 myGLCD.print("c",250,145);
 myGLCD.print("Room:",15, 75);
 myGLCD.print(sensorPrintout1,165,75);
 myGLCD.print("c",250,75);
 myGLCD.print("Led's:",15, 110);
 myGLCD.print(sensorPrintout2,165,110);
 myGLCD.print("c",250,110);
 
 //delay(750);

}
 
void gettemp() // call sensors.requestTemperatures() to issue
               // a global temp request to all devices on the bus.
{
 sensors.requestTemperatures(); // Send the command to get temperatures.
 probe01 = (sensors.getTempCByIndex(0));
 probe02 = (sensors.getTempCByIndex(1));
 probe03= (sensors.getTempCByIndex(2));
}

Berichten: 91
Geregistreerd: 23 Okt 2013, 05:50

Re: aquarium controller probleem

Berichtdoor pedro koi » 03 Dec 2016, 22:43

terug stukje bij aan werken maar loop vast. wil de functie fan toevoegen dit houd in ik wil door middel van temperatuur een fan aansturen.
men code is nu zo.
zoals je kan zien heb ik de print op men lcd wel al kunnen invullen maar loop vast bij de uitvoer ervan en zo het percentage van de snelheid van de fan deze komt niet tevoorschijn nog zit met een compileerfout bij de if functie void loop.



Code: Alles selecteren
//libraries for lcd screen
#include <UTFT.h>  //

// Libraries for DS1820 and Onewire
#include <OneWire.h>
#include <DallasTemperature.h>

//libraries for the ds3231 clock

#include "RTClib.h"
#include <Wire.h>


extern uint8_t SmallFont[];
extern uint8_t BigFont[];

RTC_DS1307 RTC;

#define ONE_WIRE_BUS 13
float probe01;
float probe02;
float probe03;


OneWire oneWire(ONE_WIRE_BUS); // Setup onewire instance to communicate with devices.Uno 2 imposible other
DallasTemperature sensors(&oneWire);


// create an instance of the library
UTFT myGLCD(SSD1289, 38, 39, 40, 41); // start up an instance of the TFT screen

//fan aanspreken
int fan= 11; // pin waar fan is
int temp;
int tempMin= 24;//temperatuur start fan
int tempMax= 50; // max temperatuur waneer de fan 100% werkt
int fanSpeed;
int fanLCD;

// char array to print to the screen
char sensorPrintout[10];  //For print out full numbers of dallas ds18b20 0*28, 0*60, 0*E5, 0*4C, 0*05, 0*00, 0*00, 0*12
char sensorPrintout1[10];
char sensorPrintout2[10];//For print out full numbers of dallas ds18b20 0*28, 0*D0, 0*63, 0*4D, 0*05, 0*00, 0*00, 0*CD


void setup()
{
  //fan opstart
  pinMode (fan, OUTPUT);

 
  //klok en lcd opstart
  myGLCD.InitLCD();
  myGLCD.clrScr();
  myGLCD.setColor(0, 255, 255);
  // Start up the library
  sensors.begin();
  Serial.begin(9600);
  Wire.begin();
  RTC.begin();
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
   // RTC.adjust(DateTime(__DATE__, __TIME__));
  }
}

void loop()
{
 DateTime now = RTC.now();
 
 gettemp(); // Read the temperature.
 String probe01 = String(sensors.getTempCByIndex(0));
 probe01.toCharArray(sensorPrintout, 5);
 String probe02 = String(sensors.getTempCByIndex(1));
 probe02.toCharArray(sensorPrintout1, 5);
 String probe03 = String(sensors.getTempCByIndex(2));
 probe03.toCharArray(sensorPrintout2, 5);
 


 temp = (sensorPrintout2);
 
 if(temp &lt ; tempMin) { // if temp is lower than minimum temp fanSpeed = 0; // fan is not spinning digitalWrite(fan, LOW); } if((temp &gt;= tempMin) &amp;&amp; (temp &lt;= tempMax)) { // if temperature is higher than minimum temp fanSpeed = map(temp, tempMin, tempMax, 32, 255); // the actual speed of fan fanLCD = map(temp, tempMin, tempMax, 0, 100); // speed of fan to display on LCD analogWrite(fan, fanSpeed); // spin the fan at the fanSpeed speed } if(temp &gt; tempMax) {        // if temp is higher than tempMax
     digitalWrite(led, HIGH);  // turn on led
   } else {                    // else turn of led
     digitalWrite(led, LOW);
   }
 
 //kiezen kleur tekst en achtergrond lcd scherm
 
 myGLCD.setColor(0, 255, 0);//kleur lettertype
 myGLCD.setFont(SmallFont);
 
//print tekst op lcd scherm
 
 myGLCD.print("pedro schrimp tank", 100, 5);
 myGLCD.setFont(BigFont);
 
 //print datum en klok op lcd scherm
 
 myGLCD.printNumI(now.year(), 200, 20);
 myGLCD.print("/", 170, 20);
 myGLCD.printNumI(now.month(), 120, 20);
 myGLCD.print("/", 90, 20);
 myGLCD.printNumI(now.day(), 60, 20);
 
 myGLCD.printNumI(now.hour(), 60, 40);
 myGLCD.print("Min", 150, 40);
 myGLCD.printNumI(now.minute(), 120, 40);
 myGLCD.print("H", 90,40);
 myGLCD.printNumI(now.second(), 210, 40);
 myGLCD.print("Sec" ,250,40);
 
 
 
 //print temperatuur en fan snelheid en barometer op lcd scherm
 myGLCD.print("Room:",15, 75);
 myGLCD.print(sensorPrintout1,165,75);
 myGLCD.print("C",250,75);
 
 myGLCD.print("Led's:",15, 110);
 myGLCD.print(sensorPrintout2,165,110);
 myGLCD.print("C",250,110);

 myGLCD.print("Aquarium:", 15, 145);
 myGLCD.print(sensorPrintout,165,145);
 myGLCD.print("C",250,145);

 myGLCD.print("Fan speed:", 15,180);
 myGLCD.print(fanLCD, 175,180);
 myGLCD.print("%", 250,180);

 myGLCD.print("Barometer:", 15, 215);
 myGLCD.print("" ,175, 215);
 myGLCD.print("Mb", 250, 215);
 
 delay(750);

}
 
void gettemp() // call sensors.requestTemperatures() to issue
               // a global temp request to all devices on the bus.
{
 sensors.requestTemperatures(); // Send the command to get temperatures.
 probe01 = (sensors.getTempCByIndex(0));
 probe02 = (sensors.getTempCByIndex(1));
 probe03= (sensors.getTempCByIndex(2));
}

Gebruikers-avatar
Berichten: 2655
Geregistreerd: 06 Aug 2016, 01:03

Re: aquarium controller probleem

Berichtdoor Koepel » 03 Dec 2016, 23:34

Gebruik dezelfde stijl van je broncode, en doe het inspringen en de haakjes altijd op dezelfde manier. Dan kun namelijk veel sneller zien hoe de structuur van de code is.

In voorbeelden staat het gebruik van een array "sensorPrintout" om een floating point getal om te zetten naar tekst. Ik kan er maar niet aan wennen om daar de ".toCharArray()" van de String object voor te gebruiken.
Vanwege die rare constructie raak je al snel in de problemen.

Ben je bekend met "sprintf()" of met "dtostrf()" ?

Wat wil je met deze regel ?
Code: Alles selecteren
temp = (sensorPrintout2);

De 'temp' is een integer. De 'sensorPrintout2' is een array van 10 characters. Die twee hebben weinig met elkaar te maken.

En wat wil je met deze regel ?
Code: Alles selecteren
if (temp & lt ; tempMin)

Staat dat echt zo in je broncode ? Heb je dat van een HTML pagina gekopieerd ? Of ging er iets fout bij het kopiëren naar dit forum ? De "& lt ;" is (zonder spaties) de HTML code voor het '<' teken.

Wanneer je een '//' gebruikt, dan wordt alles er achter commentaar, tot aan het einde van de regel. Je hebt nog heel wat code in dat commentaar staan (op diezelfde regel).

Ik ben heel serieus: zet eerst het inspringen en spaties overal goed zodat iedere spatie en iedere keer inspringen correct is. Je kunt beginnen met op Ctrl+T te drukken.

Berichten: 91
Geregistreerd: 23 Okt 2013, 05:50

Re: aquarium controller probleem

Berichtdoor pedro koi » 04 Dec 2016, 11:04

Inderdaad was een vb van een html code ik kopieerde heb er het nodige uit gehaald wand was een sketch met een tft scherm en een ledje die aan hing als de fan draaide dit heb ik niet nodig.
Heb dus enkel stuk nodig die de fan doet draaien aan de hand van de temp en stukje die % berekend van de snelheid van de fan en dit print op men lsd scherm.
Ha nu eerst eens de code juist zetten zoals je zij is inderdaad slordig nu.

Berichten: 91
Geregistreerd: 23 Okt 2013, 05:50

Re: aquarium controller probleem

Berichtdoor pedro koi » 04 Dec 2016, 18:38

code beetje opgeruimd si.
intussen uw quote van de // als commentaar omgezet zodat het geen commentaar meer is wand dit was precies het stukje nodig is om de fan op de lcd te zetten.

de if comment die ervoor zorgde dat een ledje hing branden of uit hing is verwijderd zelf niet nodig.

temp = (sensorPrintout2);

daarmee wil ik maken de temp gelezen word van de sensorPrintout2 das de sensor waar de fan moet mee geregeld worden.

ergens loopt het nog steeds verkeerd in de void loop .



Code: Alles selecteren
//libraries for lcd screen

#include <UTFT.h>  //

// Libraries for DS1820 and Onewire

#include <OneWire.h>
#include <DallasTemperature.h>

//libraries for the ds3231 clock

#include "RTClib.h"
#include <Wire.h>


extern uint8_t SmallFont[];
extern uint8_t BigFont[];

RTC_DS1307 RTC;

#define ONE_WIRE_BUS 13
float probe01;
float probe02;
float probe03;


OneWire oneWire(ONE_WIRE_BUS); // Setup onewire instance to communicate with devices.Uno 2 imposible other
DallasTemperature sensors(&oneWire);


// create an instance of the library

UTFT myGLCD(SSD1289, 38, 39, 40, 41); // start up an instance of the TFT screen

//fan aanspreken

int fan = 11; // pin waar fan is
int temp;
int tempMin = 24; //temperatuur start fan
int tempMax = 50; // max temperatuur waneer de fan 100% werkt
int fanSpeed;
int fanLCD;

// char array to print to the screen
char sensorPrintout[10];  //For print out full numbers of dallas ds18b20 0*28, 0*60, 0*E5, 0*4C, 0*05, 0*00, 0*00, 0*12
char sensorPrintout1[10];
char sensorPrintout2[10];//For print out full numbers of dallas ds18b20 0*28, 0*D0, 0*63, 0*4D, 0*05, 0*00, 0*00, 0*CD


void setup()
{
  //fan opstart
  pinMode (fan, OUTPUT);


  //klok en lcd opstart
 
  myGLCD.InitLCD();
  myGLCD.clrScr();
  myGLCD.setColor(0, 255, 255);
 
  // Start up the library
 
  sensors.begin();
  Serial.begin(9600);
  Wire.begin();
  RTC.begin();
  if (! RTC.isrunning())
  {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    // RTC.adjust(DateTime(__DATE__, __TIME__));
  }
}

void loop()
{
  DateTime now = RTC.now();

  gettemp(); // Read the temperature.
  String probe01 = String(sensors.getTempCByIndex(0));
  probe01.toCharArray(sensorPrintout, 5);
  String probe02 = String(sensors.getTempCByIndex(1));
  probe02.toCharArray(sensorPrintout1, 5);
  String probe03 = String(sensors.getTempCByIndex(2));
  probe03.toCharArray(sensorPrintout2, 5);



  temp = (sensorPrintout2);

  if (temp &lt; tempMin)
  {
    if temp is lower than minimum temp fanSpeed = 0;
      fan is not spinning digitalWrite(fan, LOW);
  }

  if ((temp & gt; = tempMin) &amp; &amp; (temp &lt; = tempMax))
  {
    if temperature is higher than minimum temp fanSpeed = map(temp, tempMin, tempMax, 32, 255);
      the actual speed of fan fanLCD = map(temp, tempMin, tempMax, 0, 100);
      speed of fan to display on LCD analogWrite(fan, fanSpeed);
      spin the fan at the fanSpeed speed
  }

  //kiezen kleur tekst en achtergrond lcd scherm

  myGLCD.setColor(0, 255, 0);//kleur lettertype
  myGLCD.setFont(SmallFont);

  //print tekst op lcd scherm

  myGLCD.print("pedro schrimp tank", 100, 5);
  myGLCD.setFont(BigFont);

  //print datum en klok op lcd scherm

  myGLCD.printNumI(now.year(), 200, 20);
  myGLCD.print("/", 170, 20);
  myGLCD.printNumI(now.month(), 120, 20);
  myGLCD.print("/", 90, 20);
  myGLCD.printNumI(now.day(), 60, 20);

  myGLCD.printNumI(now.hour(), 60, 40);
  myGLCD.print("Min", 150, 40);
  myGLCD.printNumI(now.minute(), 120, 40);
  myGLCD.print("H", 90, 40);
  myGLCD.printNumI(now.second(), 210, 40);
  myGLCD.print("Sec" , 250, 40);



  //print temperatuur en fan snelheid en barometer op lcd scherm
 
  myGLCD.print("Room:", 15, 75);
  myGLCD.print(sensorPrintout1, 165, 75);
  myGLCD.print("C", 250, 75);

  myGLCD.print("Led's:", 15, 110);
  myGLCD.print(sensorPrintout2, 165, 110);
  myGLCD.print("C", 250, 110);

  myGLCD.print("Aquarium:", 15, 145);
  myGLCD.print(sensorPrintout, 165, 145);
  myGLCD.print("C", 250, 145);

  myGLCD.print("Fan speed:", 15, 180);
  myGLCD.print(fanLCD, 175, 180);
  myGLCD.print("%", 250, 180);

  myGLCD.print("Barometer:", 15, 215);
  myGLCD.print("" , 175, 215);
  myGLCD.print("Mb", 250, 215);

  delay(750);

}

  void gettemp() // call sensors.requestTemperatures() to issue
                 
{
  sensors.requestTemperatures(); // Send the command to get temperatures.
  probe01 = (sensors.getTempCByIndex(0));
  probe02 = (sensors.getTempCByIndex(1));
  probe03 = (sensors.getTempCByIndex(2));
}

Volgende

Terug naar Overige projecten

Wie is er online?

Gebruikers in dit forum: Geen geregistreerde gebruikers en 36 gasten