Skip to content
Snippets Groups Projects
Commit cda4608b authored by Bérénice Courtin's avatar Bérénice Courtin
Browse files

Update docs/assignments/week12.md

parent 05b4601c
Branches
No related tags found
No related merge requests found
Pipeline #357605 passed
......@@ -129,18 +129,22 @@ This tutorial [^5] was created using..
Use the three backticks to separate code.
```
// the setup function runs once when you press reset or power the board
int pump = 9;
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
pinMode(pump, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
for(int i=70; i<255; i=i+10){
analogWrite(pump, i);
delay(200);
}
for(int i=255; i>70; i=i-10){
analogWrite(pump, i);
delay(200);
}
}
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment