Référence Du Langage Arduino En Français - DigitalWrite()
Maybe your like
- TUTORIALS
- HARDWARE & TOOLS
- REFERENCES
- FAQs
- ABOUT US
- English |
- Deutsch |
- Português |
- 한국어 |
- Français |
- Español
Sketch
- loop()
- setup()
Control Structure
- break
- continue
- Boucle do - while
- if / else
- Boucle for
- goto
- if (condition)
- return
- switch / case
- Boucle while
Further Syntax
- // et /* */ Commentaires
- {} Accolades
- #define
- #include
- ; point virgule
Data Types
- Tableaux de variables
- boolean
- byte
- char
- double
- float
- int
- long
- Les chaînes de caractères
- String()
- unsigned int
- unsigned long
- void
- word
Constants
- Les constantes Arduino prédéfinies: INPUT, INPUT_PULLUP, OUTPUT, HIGH, LOW, LED_BUILTIN, true, false.
- Floating Point Constants
- Les expressions numériques entières
Variable Scope & Qualifiers
- const
- La portée des variables
- static
- volatile
Digital IO
- digitalRead()
- digitalWrite()
- pinMode()
Analog IO
- analogRead()
- analogReference(type)
- analogWrite()
Advanced IO
- noTone()
- pulseIn()
- shiftOut()
- tone()
Serial
- Librairie Serial pour la communication série
- Serial.available()
- Serial.begin()
- Serial.find()
- Serial.findUntil()
- Serial.flush()
- Serial.parseFloat()
- Serial.parseInt()
- Serial.peek()
- Serial.print()
- Serial.println()
- Serial.read()
- Serial.readBytes()
- Serial.readBytesUntil()
- Serial.setTimeout()
- Serial.write()
Stream
- Librairie Stream
- Stream.available()
- Stream.find()
- Stream.findUntil()
- Stream.flush()
- Stream.parseFloat()
- Stream.parseInt()
- Stream.peek()
- Stream.read()
- Stream.readBytes()
- Stream.readBytesUntil()
- Stream.setTimeout()
String Functions
- String.charAt()
- String.compareTo()
- String.concat()
- String.endsWith()
- String.equals()
- String.equalsIgnoreCase()
- String.getBytes()
- String.indexOf()
- String.lastIndexOf()
- String.length()
- String.replace()
- String.setCharAt()
- String.startsWith()
- String.substring()
- String.toCharArray()
- String.toLowerCase()
- String.toUpperCase()
- String.trim()
String Operators
- String opérateur +=
- String.opérateur ==
- String opérateur +
- String [] (accès à un élément)
Time
- delay()
- delayMicroseconds()
- micros()
- millis()
Math
- abs()
- constrain()
- map()
- max()
- min()
- pow()
- sq()
- sqrt()
Bits and Bytes
- bit()
- bitClear()
- bitRead()
- bitSet()
- bitWrite()
- highByte()
- lowByte()
Arithmetic Operators
- + Addition
- = opérateur d'assignement
- / Division
- * Multiplication
- % (modulo)
- - Soustraction
Bitwise Operators
- << (Décalage des bits vers la gauche)
- >> (Décalage des bits vers la droite)
- & (Opérateur "bit à bit" ET)
- ~ (Opérateur "bit à bit" NON)
- | (Opérateur bit à bit OU)
- ^ (Opérateur "bit à bit" OU EXCLUSIF)
Boolean Operators
- && (ET logique)
- ! (NON logique)
- || ( OU logique)
Compound Operators
- += (addition composée)
- &= (ET bit à bit composé)
- |= (OU bit à bit composé)
- /= (division composée)
- *= (multiplication composée)
- -= (soustraction composée)
- -- (décrément)
- ++ (incrément)
Conversion
- byte()
- char()
- float()
- int()
- long()
Random Numbers
- random()
- randomSeed()
Trigonometry
- cos()
- sin()
- tan()
External Interrupts
- attachInterrupt (interruption, fonction, mode)
- detachInterrupt(interruption)
Interrupts
- interrupts()
- noInterrupts()
Utilities
- PROGMEM
- sizeof
Pointer Access Operators
- Les pointeurs : & (référence) et * (déréférence)
Description
Met un niveau logique HIGH (HAUT en anglais) ou LOW (BAS en anglais) sur une broche numérique. Si la broche a été configurée en SORTIE avec l'instruction pinMode(), sa tension est mise à la valeur correspondante : 5V (ou 3.3V sur les cartes Arduino 3.3V) pour le niveau HAUT, 0V (masse) pour le niveau BAS.
Syntaxe
digitalWrite(broche, valeur)Paramètres
- broche: le numéro de la broche de la carte Arduino
- valeur: HIGH ou LOW (ou bien 1 ou 0)
Valeurs Renvoyées
- Aucune
Exemple
int ledPin = 13; // LED connectée à la broche numérique n° 13 void setup() { pinMode(ledPin, OUTPUT); // met la broche utilisée avec la LED en SORTIE } void loop() { digitalWrite(ledPin, HIGH); // allume la LED delay(1000); // pause 1 seconde digitalWrite(ledPin, LOW); // éteint la LED delay(1000); // pause 1 seconde }Ce programme met la broche 13 au niveau HAUT (=1), fait une pause de 1 seconde, puis met la broche au niveau BAS (=0), fait une nouvelle pause d'une seconde, puis le programme boucle.
※ Remarque:
Les broches analogiques peuvent être utilisées en tant que broches numériques, représentées par les nombres 14 (entrée analogique 0) à 19 (entrée analogique 5).
void setup() { pinMode(A5, OUTPUT); // sets the digital pin A5 as output } void loop() { digitalWrite(A5, HIGH); // sets the digital pin A5 on delay(1000); // waits for a second digitalWrite(A5, LOW); // sets the digital pin A5 off delay(1000); // waits for a second }Si la broche est configurée en ENTREE, écrire un niveau HAUT sur cette broche a pour effet d'activer la résistance interne de 20K de "rappel au plus" (pullup) sur cette broche (voir le tutoriel sur les broches numériques). A l'inverse, mettre un niveau BAS sur cette broche en ENTREE désactivera le pullup interne. Exemple :
pinMode(pin, INPUT); // configure la broche en entrée digitalWrite(pin, HIGH); // écrit la valeur HIGH (=1) sur la broche en entrée // ce qui active la résistance de "rappel au +" (pullup) au plus de la broche※ ARDUINO BUY RECOMMENDATION
| Arduino UNO R3 |
| Arduino Starter Kit |
※ OUR MESSAGES
- We are AVAILABLE for HIRE. See how to hire us to build your project
Tag » Arduino Write Byte To Digital Pins
-
Writing An Output Byte Instead Of Single Pin - Arduino Forum
-
Parallel I/O - E.g Reading Or Writing A Whole Byte, Not One Pin At A Time
-
Byte Digital Output - Programming Questions - Arduino Forum
-
Converting Digital Pin Input To Byte - Arduino Forum
-
8-Bit IO Port Library For Arduino - Arduino Project Hub
-
Digital Pins To Byte Variable... - Arduino Forum
-
Example Needed Using Byte To DigitalWrite Pins - Arduino Forum
-
Assigning A Byte To Port Pins - Arduino Forum
-
Arduino And Port Manipulation : 9 Steps - Instructables
-
4. Serial Communications - Arduino Cookbook [Book] - O'Reilly
-
How To Manipulate Arduino Pins Simultaneously
-
Getting Started With Arduino
-
22.1: DigitalWrite() - Engineering LibreTexts