Emotion Detector

 

When a happy face is detected, the LED ring of Halocode will light up, and make a smiling face.

1.png

 

Add a sprite

1. Delete default sprite Panda

2.gif

 

2. Add a new sprite, Empty button14

3.gif

 

3. Change the color, and size of the button.

4.gif

 

4. In the Blocks Area, click "+ extension" to add Cognitive Services (AI) blocks

5.gif

 

5. Drag an Events block when this sprite clicked to the Scripts Area. Add an AI block  recognize emotion after (1) seconds

6.gif

 

6. Add a Control block ig () then (), an AI block emotion is (happiness)?, and an Events block broadcast (). Create a new piece of message named "laugh"

7.gif

 

7. Check the box of AI block happiness value () to display the value on stage

8.gif

 

Halocode makes a smiling face

8. Add an Events block 当when I receive (laugh), and a Lighting block show (). Draw a smiling face

9.gif

 

9. Add a Control block wait (2) seconds, and a Lighting block light off all LEDs

0.gif

Download code


Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.