⚲
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 (727 octets)
Task #13251
» sketch_200716a.pde
Code Processing -
Anonyme, 07/10/2021 13:20
import
processing
.
serial
.
*
;
import
controlP5
.
*
;
Serial
port
;
ControlP5
cp5
;
PFont
font
;
void
setup
(){
size
(
300
,
200
);
printArray
(
Serial
.
list
());
port
=
new
Serial
(
this
,
Serial
.
list
()[
1
],
9600
);
cp5
=
new
ControlP5
(
this
);
font
=
createFont
(
"Arial"
,
18
);
cp5
.
addButton
(
"ON"
)
.
setPosition
(
40
,
50
)
.
setSize
(
100
,
50
)
;
cp5
.
addButton
(
"OFF"
)
.
setPosition
(
160
,
50
)
.
setSize
(
100
,
50
)
;
cp5
.
addButton
(
"Blink"
)
.
setPosition
(
100
,
120
)
.
setSize
(
100
,
50
)
;
}
void
draw
(){
background
(
160
,
0
,
150
);
fill
(
0
,
210
,
190
);
textFont
(
font
);
text
(
"LED CONTROL"
,
90
,
30
);
}
void
ON
(){
port
.
write
(
"O"
);
}
void
OFF
(){
port
.
write
(
"I"
);
}
void
Blink
(){
port
.
write
(
"B"
);
}
« Précédent
1
2
3
Suivant »
(3-3/3)
Chargement...