Salut,
J'ai crée un port série virtuel sous linux ?
Mais je vois pas comment l'utiliser sous Arduino pour exécuter ce code et le simuler sous proteus :
Le menu "port" est grisé :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 const int outPutPin = 13; void setup() { Serial.begin(9600); pinMode(outPutPin , OUTPUT); } void loop() { int val = 0; int buffer = 0; buffer = Serial.available(); while (buffer > 0) { val = Serial.read(); Serial.print(val); buffer = Serial.available(); } if (val == 'h') //La LED séteint digitalWrite(outPutPin , HIGH); if (val == 'l') //La LED s'allume digitalWrite(outPutPin , LOW); }
schéma proteus :
Merci
Partager