I needed to perform maintenance checks to ensure the security of our clients' information. Therefore, I developed this code to read the relevant Excel spreadsheet and show me which clients require some action.
;#SingleInstance prompt
OnExit, saida
global eab := ComObjCreate("Excel.Application")
global ab:= eab.Workbooks.Open("Path to archive", 1)
eab.Visible := visibilidade = 1 ? True : False
iNcol := 10
sClientes := ["Array with colums to be verified ex:A6"]
sStatus := ["Array with colums to be verified ex:g6"]
for i, sCol in sStatus {
status := eab.Range(sCol).Value
if (status == "Not OK") {
cliente := eab.Range(sClientes[i]).Value
MsgBox Need some action: %cliente%
}
}
I tried to make a alarm clock that can interact to energy panels like interrupters, also it is just a start to automatica my home.. ^^
Real Time Clock : Rele com Hora Marcada (v1.0)
Acionamento de um rele em hora e minuto preestabelecidos.
//Inclusao das bibliotecas
#include
#include "RTClib.h"
const int PINO_RELE = 2; //pin defined for connection to the relay
const int HORA = 10; //hour variable
const int MINUTO = 53; //minute variable
// Used RTC model (DS1307 ou DS3132)
RTC_DS1307 rtc; //Object RTC of class DS1307
//RTC_DS3231 rtc; //Object RTC of class DS3132
char diasDaSemana[7][12] = {"Domingo", "Segunda", "Terca", "Quarta", "Quinta", "Sexta", "Sabado"}; //Dias da semana
void setup () {
Serial.begin(9600); //Iniciate serial comunication
if (!rtc.begin()) {
Serial.println("RTC NAO INICIALIZADO"); //print text
while (1);
}
//rtc.adjust(DateTime(2019, 3, 18, 10, 53, 00)); // Adjust the time of RTC to date and time specified by the user
delay(100); //100 Millisseconds
pinMode(PINO_RELE, OUTPUT);
digitalWrite(PINO_RELE, LOW);
}
void loop ()
{
DateTime agora = rtc.now(); // Read data of date and time
Serial.print("Data: ");
Serial.print(agora.day(), DEC);
Serial.print('/');
Serial.print(agora.month(), DEC);
Serial.print('/');
Serial.print(agora.year(), DEC);
Serial.print(" / Dia da semana: ");
Serial.print(diasDaSemana[agora.dayOfTheWeek()]);
Serial.print(" / Horas: ");
Serial.print(agora.hour(), DEC);
Serial.print(':');
Serial.print(agora.minute(), DEC);
Serial.print(':');
Serial.print(agora.second(), DEC);
Serial.println();
delay(1000);
if ((agora.hour() == HORA) && (agora.minute() == MINUTO)) { // if in instant that the time is equal to variable hour
digitalWrite(PINO_RELE, HIGH); //start rele
} else { //else
digitalWrite(PINO_RELE, LOW); //stop rele
}
}