Transcrire un algorithme en langage Arduino

Fermé
Zaakarroto Messages postés 1 Date d'inscription mardi 30 avril 2019 Statut Membre Dernière intervention 30 avril 2019 - 30 avril 2019 à 09:42
Bonjour,

Pourriez-vous m'aider à transcrire cet algorithme en langage Arduino afin de finaliser mon projet s'il vous plaît?



Yun

Librairie permettant de lier les deux processeurs <Bridge>

Initialiser le Serveur

Declarer Bp en broche 2
Declarer LED en broche 12

Declarer EtatBp = 0
Declarer EtatCapteur = 0
Declarer EtatOxyMetre = 0
Declarer Signal = 0
Declarer LimiteOxy = 550 de type entier
Declarer LedAllumer = 0

fonction TestOxymetre()

signal = LireBrocheanalogique(A0)
Afficher(Signal)
Si signal > LimiteOxy alors

Afficher ("Limite atteinte" )
EtatOxyMetre = 1

sinon

EtatOxyMetre = 0
FinSi

FinTestOxymetre

fonction Setup()

Initialiser le moniteur Serie(9600 bauds)
Initialiser la communication entre les deux processeurs

déclarer broche Bp en Entree
déclarer broche LED en sortie

FinSetup

fonction Loop()

Attendre qu'un client web connecté (port 80)

Si client alors

Déclarer command de type
definir Command = Command envoyer par le client
command = command sans espace
Afficher Command sur debug

fonction TestOxymetre

Si command = Demande alors

Afficher Command sur debug

Repondre EtatBp au client
Repondre EtatOxyMetre au client
Repondre EtatCapteur au client


FinSi

Si command = BpAppuyer alors

Afficher Command sur debug

Allumer LED
LedAllumer = 1

FinSi

Si Bp = 1 alors

Si LedAllumer = 0 alors

EtatBp = 1

sinon

Eteindre LED
LedAllumer = 0
EtatBp = 0

FinSi

FinSi

FinLoop

Configuration: Windows / Chrome 73.0.3683.103
A voir également: