SlideShare une entreprise Scribd logo
1  sur  8
CONDITIONNELLES
LEÇON DE
PROGRAMMATION
POUR DÉBUTANT
Objectifs de la leçon
1. Apprenez à ce que votre robot décide quoi faire de différents choix
2. Apprenez à utiliser un bloc de commutation
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 2
Blocs de commutation
Poser une question au robot et faire
quelque chose de différent en
fonction de la réponse
◦ Exemple: le robot voit-il une ligne?
Ou pas?
Fondamentalement une question
OUI / NON
Les blocs de commutation se
trouvent dans l'onglet orange / flux
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 3
The question being
asked: is the touch
sensor pressed
Run this code if
the answer is no
Run this code if
the answer is yes
DÉFI 1: Bloc commutateur
Défi: Ecrivez un programme qui
modifie l’affichage en fonction de
l’appui ou non sur le capteur
tactile.
Si vous appuyez dessus, votre EV3
est heureuse! Affichez un visage
souriant. Si pas pressé, l'EV3 est
triste! Afficher un visage triste.
Astuce: Vous devrez utiliser le bloc
d'affichage, les boucles et les blocs
de commutation!
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 4
SOLUTION Défi 1
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 5
Display Block
Display Block
Wait Block
Loop
Touch
Sensor
Selected
Défi 2: Bloc commutateur
Can you write a program that display big eyeballs
if you touch it once and a sad face if you touch it
a second time and toggles back and forth.
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 6
Défi 2 : solution
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 7
Fin de la leçon
8

Contenu connexe

Plus de Romaric Saounde Tsopnang

Plus de Romaric Saounde Tsopnang (20)

Ap loops2 - Beginner
Ap   loops2 - BeginnerAp   loops2 - Beginner
Ap loops2 - Beginner
 
Ao light nxt2 - Beginner
Ao   light nxt2 - BeginnerAo   light nxt2 - Beginner
Ao light nxt2 - Beginner
 
An capteur de couleur - Débutant
An   capteur de couleur - DébutantAn   capteur de couleur - Débutant
An capteur de couleur - Débutant
 
An color Sensor - Beginner
An   color Sensor - BeginnerAn   color Sensor - Beginner
An color Sensor - Beginner
 
Al touch2 - Beginner
Al   touch2 - BeginnerAl   touch2 - Beginner
Al touch2 - Beginner
 
Ak custom imagessounds2 - Beginner
Ak   custom imagessounds2 - BeginnerAk   custom imagessounds2 - Beginner
Ak custom imagessounds2 - Beginner
 
Ak image et son standard - Débutant
Ak   image et son standard - DébutantAk   image et son standard - Débutant
Ak image et son standard - Débutant
 
Aj display2 - Beginner
Aj   display2 - BeginnerAj   display2 - Beginner
Aj display2 - Beginner
 
Aj affichage - Débutant
Aj   affichage - DébutantAj   affichage - Débutant
Aj affichage - Débutant
 
Ai turning2 - Beginner
Ai   turning2 - BeginnerAi   turning2 - Beginner
Ai turning2 - Beginner
 
Ai virages - Débutant
Ai   virages - DébutantAi   virages - Débutant
Ai virages - Débutant
 
Ah pseudocode2 - Beginner
Ah   pseudocode2 - BeginnerAh   pseudocode2 - Beginner
Ah pseudocode2 - Beginner
 
Ah pseudocode-fr - Débutant
Ah   pseudocode-fr - DébutantAh   pseudocode-fr - Débutant
Ah pseudocode-fr - Débutant
 
Ag moving straight2 - Beginner
Ag   moving straight2 - BeginnerAg   moving straight2 - Beginner
Ag moving straight2 - Beginner
 
Ag deplacement droit - Débutant
Ag   deplacement droit - DébutantAg   deplacement droit - Débutant
Ag deplacement droit - Débutant
 
Ae common issues2 - Beginner
Ae   common issues2 - BeginnerAe   common issues2 - Beginner
Ae common issues2 - Beginner
 
Ae problemes frequents - Débutant
Ae   problemes frequents - DébutantAe   problemes frequents - Débutant
Ae problemes frequents - Débutant
 
Ac introduction2 - Beginner
Ac   introduction2 - BeginnerAc   introduction2 - Beginner
Ac introduction2 - Beginner
 
Ac introduction-fr - Débutant
Ac   introduction-fr - DébutantAc   introduction-fr - Débutant
Ac introduction-fr - Débutant
 
Ab installing updates2 - Beginner
Ab   installing updates2 - BeginnerAb   installing updates2 - Beginner
Ab installing updates2 - Beginner
 

Aq les conditionnelles - Débutant

  • 2. Objectifs de la leçon 1. Apprenez à ce que votre robot décide quoi faire de différents choix 2. Apprenez à utiliser un bloc de commutation © EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 2
  • 3. Blocs de commutation Poser une question au robot et faire quelque chose de différent en fonction de la réponse ◦ Exemple: le robot voit-il une ligne? Ou pas? Fondamentalement une question OUI / NON Les blocs de commutation se trouvent dans l'onglet orange / flux © EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 3 The question being asked: is the touch sensor pressed Run this code if the answer is no Run this code if the answer is yes
  • 4. DÉFI 1: Bloc commutateur Défi: Ecrivez un programme qui modifie l’affichage en fonction de l’appui ou non sur le capteur tactile. Si vous appuyez dessus, votre EV3 est heureuse! Affichez un visage souriant. Si pas pressé, l'EV3 est triste! Afficher un visage triste. Astuce: Vous devrez utiliser le bloc d'affichage, les boucles et les blocs de commutation! © EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 4
  • 5. SOLUTION Défi 1 © EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 5 Display Block Display Block Wait Block Loop Touch Sensor Selected
  • 6. Défi 2: Bloc commutateur Can you write a program that display big eyeballs if you touch it once and a sad face if you touch it a second time and toggles back and forth. © EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 6
  • 7. Défi 2 : solution © EV3LESSONS.COM, 2016, (LAST EDIT: 7/04/2016) 7
  • 8. Fin de la leçon 8