Giter Site home page Giter Site logo

gleissonjoaquim3 / clock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from canalbrincandocomideias/clock

0.0 1.0 0.0 30 KB

It substitutes a RTC module but needs to configure time each time Arduino turns on or reset

License: GNU General Public License v3.0

C++ 100.00%

clock's Introduction

Clock Library for Arduino

It substitutes a RTC module but needs to configure time each time Arduino turns on or reset

For more information about this library please visit us at https://github.com/canalBrincandoComIdeias

Reference

Include

#include "Clock.h"

Instance

Clock myClock;

Methods

void ajustaHorario(byte hora, byte minuto, byte segundo);
//Adjusts the time (to be used on SETUP) -> Acerta o horario (para uso no SETUP)
Parameters:
- byte hora:	to inform the hour between 0 and 23 -> Para informar a hora entre 0 e 23
- byte minuto:	to inform the minute 0 to 59 -> Para informar o minuto entre 0 e 59
- byte segundo:	to inform the second 0 to 59 -> Para informar o segundo entre 0 e 59
Return:
- none (void)
horario horarioAtual();
//Returns the current time -> Retorna o horario atual
Parameters:
- none
Return:
- current time (horario)
bool horarioMenor(horario valor1, horario valor2);
//Checks whether a time is smaller than the other -> Verifica se um horario é menor que o outro
Parameters:
- horario valor1:	to inform the first time to be compared -> Para informar o primeiro horario a ser informado
- horario valor2:	to inform the second time to be compared -> Para informar o segundo horario a ser informado
Return:
- true if first time is smaller than the second. Otherwise it returns false (bool)
bool horarioMaior(horario valor1, horario valor2);
//Checks whether a time is longer than the other -> Verifica se um horario é maior que o outro
Parameters:
- horario valor1:	to inform the first time to be compared -> Para informar o primeiro horario a ser informado
- horario valor2:	to inform the second time to be compared -> Para informar o segundo horario a ser informado
Return:
- true if first time is longer than the second. Otherwise it returns false (bool)
bool horarioIgual(horario valor1, horario valor2);
//Checks if two times are equal with second accuracy -> Verifica se dois horarios são iguais com precisão de segundos
Parameters:
- horario valor1:	to inform the first time to be compared -> Para informar o primeiro horario a ser informado
- horario valor2:	to inform the second time to be compared -> Para informar o segundo horario a ser informado
Return:
- true if both times are iqual. Otherwise it returns false. The comparison accuracy is second.  (bool)
bool horaMinutoIgual(horario valor1, horario valor2);
//Checks if two times are equal with minute accuracy -> Verifica se dois horarios são iguais com precisão de minutos
Parameters:
- horario valor1:	to inform the first time to be compared -> Para informar o primeiro horario a ser informado
- horario valor2:	to inform the second time to be compared -> Para informar o segundo horario a ser informado
Return:
- true if both times are iqual. Otherwise it returns false. The comparison accuracy is minute.  (bool)
horario adicionaHoras(horario origem, int horas);
//Adds or subtracts hours to specified time. -> Adiciona horas a um horario especificado
Parameters:
- horario origem: 	to inform the time to add the hours -> Informa o horario para que as horas sejam adicionadas
- int horas:			to inform the hours to be added. Negative value will subtract - Informa as horas para serem adicionadas. Valores negativos irão subtrair
Return:
- the time with the hours added or subtracted. (horario)
horario adicionaMinutos(horario origem, int minutos);
//Adds or subtracts minutes to specified time. -> Adiciona minutos a um horario especificado
Parameters:
- horario origem: 	to inform the time to add the minutes -> Informa o horario para que os minutos sejam adicionados
- int minutos:		to inform the minutes to be added. Negative value will subtract - Informa os minutos para serem adicionados. Valores negativos irão subtrair
Return:
- the time with the minutes added or subtracted. (horario)
horario adicionaSegundos(horario origem, int segundos);
//Adds or subtracts seconds to specified time. -> Adiciona segundos a um horario especificado
Parameters:
- horario origem: 	to inform the time to add the seconds -> Informa o horario para que os segundos sejam adicionados
- int segundos:		to inform the seconds to be added. Negative value will subtract - Informa os segundos para serem adicionados. Valores negativos irão subtrair
Return:
- the time with the minutes added or subtracted. (horario)
   horario adicionaMilesimos(horario origem, int milesimos);
//Adds or subtracts milliseconds to specified time. -> Adiciona milisegundos a um horario especificado
Parameters:
- horario origem: 	to inform the time to add the milliseconds -> Informa o horario para que os milisegundos sejam adicionados
- int milesimos:		to inform the miliseconds to be added. Negative value will subtract - Informa os milisegundos para serem adicionados. Valores negativos irão subtrair
Return:
- the time with the miliseconds added or subtracted. (horario)
uint32_t horarioParaMilesimo(horario origem);
//Converts time to milliseconds. -> Converte horario para milisegundos
Parameters:
- horario origem: 	to inform the time to be converted to milliseconds -> Para informar o horario a ser convertido para milisegundos
Return:
- milliseconds from informed time -> milisegundos do horario informado. (uint32_t = unsigned long)
uint32_t horarioParaSegundos(horario origem);
//Converts time to seconds. -> Converte horario para segundos
Parameters:
- horario origem: 	to inform the time to be converted to seconds -> Para informar o horario a ser convertido para segundos
Return:
- seconds from informed time -> seconds do horario informado. (uint32_t = unsigned long)
uint32_t horarioParaMinutos(horario origem);
//Converts time to minutes. -> Converte horario para minutos
Parameters:
- horario origem: 	to inform the time to be converted to minutes -> Para informar o horario a ser convertido para minutos
Return:
- minutes from informed time -> minutos do horario informado. (uint32_t = unsigned long)
horario milesimoParaHorario(uint32_t origem);
//Converts milliseconds to time. -> Converte milisegundos em horario
Parameters:
- uint32_t origem: 	to inform milliseconds to be converted to time -> Para informar os milisegundos a serem convertidos para horario
Return:
- time from informed milliseconds -> Horario dos milisegundos informados . (horario)
String horaParaTexto(horario origem);
//Converts time to text in the formmat hh:mm:ss. -> Converte horario em texto no formato hh:mm:ss
Parameters:
- horario origem: 	to inform the time to be converted to text -> Para informar o horario a ser convertido em texto
Return:
- Formated text with the informed time -> Texto formatado com o horario informado convertido . (String)
void quandoMillisZerar();
//Adjusts the clock when millis() turns to zero (up to 50 days) -> Ajuste do relogio quando o millis() zerar (a cada 50 dias aprox.)
Parameters:
- none
Return:
- none

License

Copyright (c) 2010 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

clock's People

Contributors

canalbrincandocomideias avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.