From 62b5e6323a9460116ed44030d98eed365994ac41 Mon Sep 17 00:00:00 2001 From: Montaigu-Lancelin Emilie Date: Thu, 18 Dec 2025 10:13:20 +0100 Subject: [PATCH] debuttp1812 --- Application.cpp | 32 ++++++++++++++++++++ Application.h | 37 +++++++++++++++++++++++ HelloWorld/HelloWorld.ino | 58 +++++++++++++++++++++++++++++++++++++ HelloWorld/actionneur.cpp | 2 ++ HelloWorld/actionneur.h | 11 +++++++ HelloWorld/bouton.cpp | 3 ++ HelloWorld/bouton.h | 12 ++++++++ HelloWorld/capteur.cpp | 8 +++++ HelloWorld/capteur.h | 12 ++++++++ HelloWorld/ecran.h | 12 ++++++++ HelloWorld/led.cpp | 9 ++++++ HelloWorld/led.h | 13 +++++++++ HelloWorld/peripherique.cpp | 3 ++ HelloWorld/peripherique.h | 11 +++++++ project_name.ino | 15 ++++++++++ 15 files changed, 238 insertions(+) create mode 100644 Application.cpp create mode 100644 Application.h create mode 100644 HelloWorld/HelloWorld.ino create mode 100644 HelloWorld/actionneur.cpp create mode 100644 HelloWorld/actionneur.h create mode 100644 HelloWorld/bouton.cpp create mode 100644 HelloWorld/bouton.h create mode 100644 HelloWorld/capteur.cpp create mode 100644 HelloWorld/capteur.h create mode 100644 HelloWorld/ecran.h create mode 100644 HelloWorld/led.cpp create mode 100644 HelloWorld/led.h create mode 100644 HelloWorld/peripherique.cpp create mode 100644 HelloWorld/peripherique.h create mode 100644 project_name.ino diff --git a/Application.cpp b/Application.cpp new file mode 100644 index 0000000..ee51979 --- /dev/null +++ b/Application.cpp @@ -0,0 +1,32 @@ +/********************************************************************* + * @file Apllication.cpp + * @author + * @brief Fichier source de l'application + *********************************************************************/ +#include "Application.h" + + +Application::Application() +{ + // Code + ; +} + +Application::~Application() +{ + // Code + ; +} + +void Application::init(void) +{ + // Code + ; +} + + +void Application::run(void) +{ + // Code + ; +} diff --git a/Application.h b/Application.h new file mode 100644 index 0000000..fee39a3 --- /dev/null +++ b/Application.h @@ -0,0 +1,37 @@ +/********************************************************************* + * @file Apllication.h + * @author + * @brief Fichier header de l'application + *********************************************************************/ +#ifndef APPLICATION_H_ +#define APPLICATION_H_ + +/** + * @class Application + * @brief Classe Application +*/ +class Application +{ + public : + /** + * @fn Application(); + * @brief Constructeur par defaut + */ + Application(); + /** + * @fn Application(); + * @brief Destructeur + */ + ~Application(); + /** + * @fn void init(void) + * @brief Fonction d'initialisation de l'application + */ + void init(void); + /** + * @fn void run(void) + * @brief Fonction de lancement de l'application + */ + void run(void); +}; +#endif \ No newline at end of file diff --git a/HelloWorld/HelloWorld.ino b/HelloWorld/HelloWorld.ino new file mode 100644 index 0000000..ebd2d35 --- /dev/null +++ b/HelloWorld/HelloWorld.ino @@ -0,0 +1,58 @@ +/* + Hello World.ino + 2013 Copyright (c) Seeed Technology Inc. All right reserved. + + Author:Loovee + 2013-9-18 + + Grove - Serial LCD RGB Backlight demo. + + 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 +*/ + +#include + +#include "ecran.h" +ecran lcd; + +const int colorR = 255; +const int colorG = 20; +const int colorB = 147; + +void setup() { + // set up the LCD's number of columns and rows: + lcd.begin(16, 2); + + lcd.setRGB(colorR, colorG, colorB); + + // Print a message to the LCD. + lcd.print("Je t'aime Raph"); + + delay(1000); +} + +void loop() { + // set the cursor to column 0, line 1 + // (note: line 1 is the second row, since counting begins with 0): + lcd.setCursor(0, 1); + // print the number of seconds since reset: + lcd.print(millis() / 1000); + + delay(100); +} + +/********************************************************************************************************* + END FILE +*********************************************************************************************************/ \ No newline at end of file diff --git a/HelloWorld/actionneur.cpp b/HelloWorld/actionneur.cpp new file mode 100644 index 0000000..282c36f --- /dev/null +++ b/HelloWorld/actionneur.cpp @@ -0,0 +1,2 @@ +#include "actionneur.h" + diff --git a/HelloWorld/actionneur.h b/HelloWorld/actionneur.h new file mode 100644 index 0000000..1d1c948 --- /dev/null +++ b/HelloWorld/actionneur.h @@ -0,0 +1,11 @@ +#ifndef actionneur_H +#define actionneur_H +#include "peripherique.h" +class actionneur : public periph { + private: + + public: + actionneur():periph(){}; +}; + +#endif \ No newline at end of file diff --git a/HelloWorld/bouton.cpp b/HelloWorld/bouton.cpp new file mode 100644 index 0000000..c54f9ed --- /dev/null +++ b/HelloWorld/bouton.cpp @@ -0,0 +1,3 @@ +#include "bouton.h" + +bouton:: bouton() :capteur(),etat(0){} \ No newline at end of file diff --git a/HelloWorld/bouton.h b/HelloWorld/bouton.h new file mode 100644 index 0000000..2336b94 --- /dev/null +++ b/HelloWorld/bouton.h @@ -0,0 +1,12 @@ +#ifndef bouton_H +#define bouton_H +#include "capteur.h" +class bouton : public capteur { + private: + bool etat; + public: + bouton(); + +}; + +#endif \ No newline at end of file diff --git a/HelloWorld/capteur.cpp b/HelloWorld/capteur.cpp new file mode 100644 index 0000000..82f0637 --- /dev/null +++ b/HelloWorld/capteur.cpp @@ -0,0 +1,8 @@ +#include "capteur.h" + +capteur:: capteur() :periph(),pin(0){} + +void init(){ + pinMode(pin, INPUT); + +} \ No newline at end of file diff --git a/HelloWorld/capteur.h b/HelloWorld/capteur.h new file mode 100644 index 0000000..72f65f1 --- /dev/null +++ b/HelloWorld/capteur.h @@ -0,0 +1,12 @@ +#ifndef capteur_H +#define capteur_H +#include "peripherique.h" +class capteur : public periph { + private: + char* pin; + public: + capteur(); + void set(void); +}; + +#endif \ No newline at end of file diff --git a/HelloWorld/ecran.h b/HelloWorld/ecran.h new file mode 100644 index 0000000..2af278d --- /dev/null +++ b/HelloWorld/ecran.h @@ -0,0 +1,12 @@ +#ifndef ecran_H +#define ecran_H +#include "actionneur.h" +#include "rgb_lcd.h" +class ecran : public actionneur, public rgb_lcd { + private: + + public: + ecran():actionneur(),rgb_lcd(){}; +}; + +#endif \ No newline at end of file diff --git a/HelloWorld/led.cpp b/HelloWorld/led.cpp new file mode 100644 index 0000000..ccba864 --- /dev/null +++ b/HelloWorld/led.cpp @@ -0,0 +1,9 @@ +#include "led.h" + + +led:: led() :actionneur(),pin(0),etat(0){} + +void init(){ + pinMode(pin, OUTPUT); + +} \ No newline at end of file diff --git a/HelloWorld/led.h b/HelloWorld/led.h new file mode 100644 index 0000000..5b0ab47 --- /dev/null +++ b/HelloWorld/led.h @@ -0,0 +1,13 @@ +#ifndef led_H +#define led_H +#include "actionneur.h" + +class led : public actionneur{ + private: + char* pin; + bool etat; + public: + led(); +}; + +#endif \ No newline at end of file diff --git a/HelloWorld/peripherique.cpp b/HelloWorld/peripherique.cpp new file mode 100644 index 0000000..acd6fbc --- /dev/null +++ b/HelloWorld/peripherique.cpp @@ -0,0 +1,3 @@ +#include "peripherique.h" + +periph::periph() : id(0) {} \ No newline at end of file diff --git a/HelloWorld/peripherique.h b/HelloWorld/peripherique.h new file mode 100644 index 0000000..a2213c1 --- /dev/null +++ b/HelloWorld/peripherique.h @@ -0,0 +1,11 @@ +#ifndef periph_H +#define periph_H + +class periph { + private: + char id; + public: + periph(); +}; + +#endif \ No newline at end of file diff --git a/project_name.ino b/project_name.ino new file mode 100644 index 0000000..49dfdf1 --- /dev/null +++ b/project_name.ino @@ -0,0 +1,15 @@ +#include "Application.h" + +Application myApplication; + +void setup() +{ + // put your setup code here, to run once: + myApplication.init(); +} + +void loop() +{ + // put your main code here, to run repeatedly: + myApplication.run(); +}