⚲
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 (695 octets)
Feature #13387
» wifi_bot_master.ino
Outillage master I²C -
Anonyme, 10/11/2021 14:13
#include
<Wire.h>
void
setup
()
{
Wire
.
begin
(
0x50
);
// join i2c bus (address optional for master)
pinMode
(
12
,
OUTPUT
);
Serial
.
begin
(
9600
);
Serial
.
println
(
"x=
\n
"
);
}
byte
x
=
'a'
;
void
loop
()
{
digitalWrite
(
12
,
HIGH
);
//begining program visual identification
Wire
.
beginTransmission
(
0x50
);
// transmit to device #0x50
Wire
.
write
(
x
);
// sends one byte
Wire
.
endTransmission
();
// stop transmitting
Serial
.
println
(
x
);
// allows to see the value of x on serial port
Serial
.
println
(
"
\n
"
);
x
++
;
if
(
x
==
'h'
)
// resets x
{
x
=
'a'
;
}
delay
(
500
);
digitalWrite
(
12
,
LOW
);
//program ends
delay
(
500
);
}
« Précédent
1
2
3
4
Suivant »
(4-4/4)
Chargement...