⚲
Projet
Général
Profil
Connexion
S'enregistrer
Accueil
Projets
Aide
Recherche
:
Polytech Ge Sous Traitance
Tous les projets
Polytech Projets Ge
»
Polytech Ge Sous Traitance
Aperçu
Activité
Roadmap
Demandes
Gantt
Calendrier
Annonces
Documents
Wiki
Fichiers
Dépôt
Télécharger (1,19 ko)
Bug #13245
» PhaseEnCours.ino
Anonyme, 20/10/2021 15:03
#include
<SPI.h>
#include
<Wire.h>
#include
<Adafruit_GFX.h>
#include
<Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306
display
(
SCREEN_WIDTH
,
SCREEN_HEIGHT
,
&
Wire
,
OLED_RESET
);
void
setup
()
{
Serial
.
begin
(
9600
);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if
(
!
display
.
begin
(
SSD1306_SWITCHCAPVCC
,
SCREEN_ADDRESS
))
{
Serial
.
println
(
F
(
"SSD1306 allocation failed"
));
for
(;;);
// Don't proceed, loop forever
}
display
.
display
();
delay
(
2000
);
// Pause for 2 seconds
}
void
loop
()
{
display
.
clearDisplay
();
display
.
setTextSize
(
2
);
// taille du texte
display
.
setTextColor
(
WHITE
);
display
.
setCursor
(
45
,
2
);
// position du curseur colonne / ligne
display
.
println
(
"ZERO"
);
display
.
setTextSize
(
1
,
6
);
display
.
setCursor
(
45
,
20
);
display
.
println
(
"BLEU"
);
display
.
setTextSize
(
1
,
6
);
display
.
println
();
display
.
display
();
delay
(
400
);
display
.
setCursor
(
25
,
20
);
}
« Précédent
1
2
3
4
Suivant »
(1-1/4)
Chargement...