This program is a simple demonstration of three states finite state machine (FSM). It has three states:
1. SAD: When IR sensor reading is >= 3
2. HAPPY: When IR sensor reading is < 3
3. ANGRY: When Light Sensor reading is < 70
It also turns on and off LEDs accordingly. i.e. Happy –> Green LED is High, Sad –> Blue LED is High, and Angry –> Red LED is High. The states are represented by faces that show the feelings. Those faces are controlled via a servo motor attached on digital pin (8)
Click Here To View The Arduino Sketch For Feelings Mill.