debuttp1812
This commit is contained in:
parent
5a214c3077
commit
62b5e6323a
15 changed files with 238 additions and 0 deletions
32
Application.cpp
Normal file
32
Application.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*********************************************************************
|
||||||
|
* @file Apllication.cpp
|
||||||
|
* @author <mettre l'adresse mail ou nom prenom>
|
||||||
|
* @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
|
||||||
|
;
|
||||||
|
}
|
||||||
37
Application.h
Normal file
37
Application.h
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*********************************************************************
|
||||||
|
* @file Apllication.h
|
||||||
|
* @author <mettre l'adresse mail ou nom prenom>
|
||||||
|
* @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
|
||||||
58
HelloWorld/HelloWorld.ino
Normal file
58
HelloWorld/HelloWorld.ino
Normal file
|
|
@ -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 <Wire.h>
|
||||||
|
|
||||||
|
#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
|
||||||
|
*********************************************************************************************************/
|
||||||
2
HelloWorld/actionneur.cpp
Normal file
2
HelloWorld/actionneur.cpp
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
#include "actionneur.h"
|
||||||
|
|
||||||
11
HelloWorld/actionneur.h
Normal file
11
HelloWorld/actionneur.h
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#ifndef actionneur_H
|
||||||
|
#define actionneur_H
|
||||||
|
#include "peripherique.h"
|
||||||
|
class actionneur : public periph {
|
||||||
|
private:
|
||||||
|
|
||||||
|
public:
|
||||||
|
actionneur():periph(){};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
3
HelloWorld/bouton.cpp
Normal file
3
HelloWorld/bouton.cpp
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#include "bouton.h"
|
||||||
|
|
||||||
|
bouton:: bouton() :capteur(),etat(0){}
|
||||||
12
HelloWorld/bouton.h
Normal file
12
HelloWorld/bouton.h
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#ifndef bouton_H
|
||||||
|
#define bouton_H
|
||||||
|
#include "capteur.h"
|
||||||
|
class bouton : public capteur {
|
||||||
|
private:
|
||||||
|
bool etat;
|
||||||
|
public:
|
||||||
|
bouton();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
8
HelloWorld/capteur.cpp
Normal file
8
HelloWorld/capteur.cpp
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#include "capteur.h"
|
||||||
|
|
||||||
|
capteur:: capteur() :periph(),pin(0){}
|
||||||
|
|
||||||
|
void init(){
|
||||||
|
pinMode(pin, INPUT);
|
||||||
|
|
||||||
|
}
|
||||||
12
HelloWorld/capteur.h
Normal file
12
HelloWorld/capteur.h
Normal file
|
|
@ -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
|
||||||
12
HelloWorld/ecran.h
Normal file
12
HelloWorld/ecran.h
Normal file
|
|
@ -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
|
||||||
9
HelloWorld/led.cpp
Normal file
9
HelloWorld/led.cpp
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#include "led.h"
|
||||||
|
|
||||||
|
|
||||||
|
led:: led() :actionneur(),pin(0),etat(0){}
|
||||||
|
|
||||||
|
void init(){
|
||||||
|
pinMode(pin, OUTPUT);
|
||||||
|
|
||||||
|
}
|
||||||
13
HelloWorld/led.h
Normal file
13
HelloWorld/led.h
Normal file
|
|
@ -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
|
||||||
3
HelloWorld/peripherique.cpp
Normal file
3
HelloWorld/peripherique.cpp
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#include "peripherique.h"
|
||||||
|
|
||||||
|
periph::periph() : id(0) {}
|
||||||
11
HelloWorld/peripherique.h
Normal file
11
HelloWorld/peripherique.h
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#ifndef periph_H
|
||||||
|
#define periph_H
|
||||||
|
|
||||||
|
class periph {
|
||||||
|
private:
|
||||||
|
char id;
|
||||||
|
public:
|
||||||
|
periph();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
15
project_name.ino
Normal file
15
project_name.ino
Normal file
|
|
@ -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();
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue