|
| 1 | +# Expressive Eyes Example |
| 2 | + |
| 3 | +This example demonstrates animated expressive eyes on various ESP32 display |
| 4 | +boards. It showcases different expressions, eye movements, and includes a |
| 5 | +continuous random demo mode perfect for a desk display. |
| 6 | + |
| 7 | +<table> |
| 8 | + <tr> |
| 9 | + <td>happy <img alt="image" src="https://github.com/user-attachments/assets/65f3afd4-fa4e-4100-9269-09b08300d37d" /></td> |
| 10 | + <td>sad <img alt="image" src="https://github.com/user-attachments/assets/d3df6898-dae4-4884-b72a-81a5c5a371ed" /></td> |
| 11 | + </tr> |
| 12 | + <tr> |
| 13 | + <td>angry <img alt="image" src="https://github.com/user-attachments/assets/43e54326-8da3-4d6b-8696-66fb85d2675c" /></td> |
| 14 | + <td>surprised <img alt="image" src="https://github.com/user-attachments/assets/a78b289c-7383-4b92-8651-bdc843b08bf7" /></td> |
| 15 | + </tr> |
| 16 | + <tr> |
| 17 | + <td>sleepy <img alt="image" src="https://github.com/user-attachments/assets/b891e260-97dd-4cce-9d80-2300816b6e79" /></td> |
| 18 | + <td>bored <img alt="image" src="https://github.com/user-attachments/assets/cc955086-bb69-41da-becc-80584b0af5c0" /></td> |
| 19 | + </tr> |
| 20 | + <tr> |
| 21 | + <td>wink left <img alt="image" src="https://github.com/user-attachments/assets/a1dde472-2bfa-480f-8a87-4deccd3b96b9" /></td> |
| 22 | + <td>wink right <img alt="image" src="https://github.com/user-attachments/assets/d92f8602-f287-441b-9612-50210be5831a" /></td> |
| 23 | + </tr> |
| 24 | + <tr> |
| 25 | + <td>looking left <img alt="image" src="https://github.com/user-attachments/assets/504d90a8-2125-45f7-8eeb-44ca6aa05cba" /></td> |
| 26 | + <td>looking right <img alt="image" src="https://github.com/user-attachments/assets/58626990-37cf-43d0-a8a6-e5ed01bd8b7c" /></td> |
| 27 | + </tr> |
| 28 | + <tr> |
| 29 | + <td>looking up <img alt="image" src="https://github.com/user-attachments/assets/1765eb2d-7c29-44c9-bbed-658af2ccabd4" /></td> |
| 30 | + <td>looking down <img alt="image" src="https://github.com/user-attachments/assets/65c19bb7-e8c4-4cee-93ba-a5be96cb2df7" /></td> |
| 31 | + </tr> |
| 32 | +</table> |
| 33 | + |
| 34 | +Videos: |
| 35 | + |
| 36 | +https://github.com/user-attachments/assets/966f5e63-aeb8-4fc3-b915-c4936fee7a1f |
| 37 | + |
| 38 | +## How to use example |
| 39 | + |
| 40 | +### Hardware Required |
| 41 | + |
| 42 | +This example can be configured to run on the following dev boards: |
| 43 | +- ESP32-S3-BOX / ESP32-S3-BOX-3 |
| 44 | +- MaTouch Rotary Display |
| 45 | +- WS-S3-Touch |
| 46 | + |
| 47 | +### Configure the project |
| 48 | + |
| 49 | +``` |
| 50 | +idf.py menuconfig |
| 51 | +``` |
| 52 | + |
| 53 | +Navigate to `Expressive Eyes Example Configuration` to: |
| 54 | +- Select your board |
| 55 | +- Choose drawing method (Full Featured or Monochrome Blue) |
| 56 | + |
| 57 | +### Build and Flash |
| 58 | + |
| 59 | +Build the project and flash it to the board, then run monitor tool to view serial output: |
| 60 | + |
| 61 | +``` |
| 62 | +idf.py -p PORT flash monitor |
| 63 | +``` |
| 64 | + |
| 65 | +(Replace PORT with the name of the serial port to use.) |
| 66 | + |
| 67 | +(To exit the serial monitor, type ``Ctrl-]``.) |
| 68 | + |
| 69 | +See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects. |
| 70 | + |
| 71 | +## Example Breakdown |
| 72 | + |
| 73 | +The example has three phases: |
| 74 | + |
| 75 | +### 1. Expression Showcase |
| 76 | + |
| 77 | +Cycles through all available expressions (3 seconds each): |
| 78 | +- Neutral |
| 79 | +- Happy |
| 80 | +- Sad |
| 81 | +- Angry |
| 82 | +- Surprised |
| 83 | + |
| 84 | +### 2. Look Direction Demo |
| 85 | + |
| 86 | +Demonstrates the look_at functionality by looking in different directions (1.5 seconds each): |
| 87 | +- Left |
| 88 | +- Right |
| 89 | +- Up |
| 90 | +- Down |
| 91 | +- Center |
| 92 | + |
| 93 | +### 3. Random Demo Mode |
| 94 | + |
| 95 | +Enters continuous random demo mode for engaging desk display: |
| 96 | +- **Natural behavior**: Mostly stays neutral with occasional emotional expressions |
| 97 | +- **Random looking**: Eyes look in random directions every 2-6 seconds |
| 98 | +- **Expression changes**: Randomly changes expression every 5-15 seconds |
| 99 | + - 50% neutral (most common) |
| 100 | + - 20% happy |
| 101 | + - 10% surprised |
| 102 | + - 10% sad |
| 103 | + - 10% angry |
| 104 | +- **Automatic blinking**: Eyes blink naturally at random intervals |
| 105 | + |
| 106 | +The random demo mode runs indefinitely, making it perfect for a continuous desk display. |
| 107 | + |
| 108 | +## Drawer Implementations |
| 109 | + |
| 110 | +The example includes two drawer implementations: |
| 111 | + |
| 112 | +### Full Featured Drawer |
| 113 | +- White eye background with black pupils |
| 114 | +- Eyebrows drawn as rotated lines with rounded caps |
| 115 | +- Cheeks for emotional expressions |
| 116 | +- Respects LVGL theme background color |
| 117 | + |
| 118 | +### Monochrome Blue Drawer |
| 119 | +- Electric blue (#00BFFF) eyes on black background |
| 120 | +- No pupils (solid colored eyes) |
| 121 | +- Minimalist aesthetic perfect for sci-fi interfaces |
| 122 | +- Black eyebrows and cheeks |
| 123 | + |
| 124 | +See [README_DRAWERS.md](./main/README_DRAWERS.md) for details on creating custom drawer implementations. |
| 125 | + |
| 126 | +## Example Output |
| 127 | + |
| 128 | +<table> |
| 129 | + <tr> |
| 130 | + <td>happy <img alt="image" src="https://github.com/user-attachments/assets/65f3afd4-fa4e-4100-9269-09b08300d37d" /></td> |
| 131 | + <td>sad <img alt="image" src="https://github.com/user-attachments/assets/d3df6898-dae4-4884-b72a-81a5c5a371ed" /></td> |
| 132 | + </tr> |
| 133 | + <tr> |
| 134 | + <td>angry <img alt="image" src="https://github.com/user-attachments/assets/43e54326-8da3-4d6b-8696-66fb85d2675c" /></td> |
| 135 | + <td>surprised <img alt="image" src="https://github.com/user-attachments/assets/a78b289c-7383-4b92-8651-bdc843b08bf7" /></td> |
| 136 | + </tr> |
| 137 | + <tr> |
| 138 | + <td>sleepy <img alt="image" src="https://github.com/user-attachments/assets/b891e260-97dd-4cce-9d80-2300816b6e79" /></td> |
| 139 | + <td>bored <img alt="image" src="https://github.com/user-attachments/assets/cc955086-bb69-41da-becc-80584b0af5c0" /></td> |
| 140 | + </tr> |
| 141 | + <tr> |
| 142 | + <td>wink left <img alt="image" src="https://github.com/user-attachments/assets/a1dde472-2bfa-480f-8a87-4deccd3b96b9" /></td> |
| 143 | + <td>wink right <img alt="image" src="https://github.com/user-attachments/assets/d92f8602-f287-441b-9612-50210be5831a" /></td> |
| 144 | + </tr> |
| 145 | + <tr> |
| 146 | + <td>looking left <img alt="image" src="https://github.com/user-attachments/assets/504d90a8-2125-45f7-8eeb-44ca6aa05cba" /></td> |
| 147 | + <td>looking right <img alt="image" src="https://github.com/user-attachments/assets/58626990-37cf-43d0-a8a6-e5ed01bd8b7c" /></td> |
| 148 | + </tr> |
| 149 | + <tr> |
| 150 | + <td>looking up <img alt="image" src="https://github.com/user-attachments/assets/1765eb2d-7c29-44c9-bbed-658af2ccabd4" /></td> |
| 151 | + <td>looking down <img alt="image" src="https://github.com/user-attachments/assets/65c19bb7-e8c4-4cee-93ba-a5be96cb2df7" /></td> |
| 152 | + </tr> |
| 153 | +</table> |
| 154 | + |
| 155 | +<img width="800" height="470" alt="image" src="https://github.com/user-attachments/assets/fcdae7f6-8bcc-4d0a-bf05-38573cb492ad" /> |
| 156 | + |
| 157 | +```console |
| 158 | +I (886) main_task: Calling app_main() |
| 159 | +[Expressive Eyes Example/I][0.889]: Starting Expressive Eyes Example |
| 160 | +[WsS3Touch/I][0.899]: Initializing LCD... |
| 161 | +[WsS3Touch/I][0.900]: Initializing SPI... |
| 162 | +[WsS3Touch/I][0.906]: Adding device to SPI bus... |
| 163 | +[WsS3Touch/I][0.911]: Initializing the display driver... |
| 164 | +[WsS3Touch/I][1.321]: Display driver initialized successfully! |
| 165 | +W (1322) ledc: the binded timer can't keep alive in sleep |
| 166 | +[WsS3Touch/I][1.324]: Initializing display with pixel buffer size: 12000 |
| 167 | +[WsS3Touch/I][1.334]: Display initialized successfully! |
| 168 | +[Expressive Eyes Example/I][1.335]: Display size: 240x280 |
| 169 | +[Expressive Eyes Example/I][1.342]: Using Monochrome Blue drawer |
| 170 | +[Expressive Eyes Example/I][1.392]: Expressive eyes initialized |
| 171 | +[Expressive Eyes Example/I][1.392]: Testing different expressions... |
| 172 | +[Expressive Eyes Example/I][1.395]: Expression: Neutral |
| 173 | +[Expressive Eyes Example/I][11.928]: Expression: Happy |
| 174 | +[Expressive Eyes Example/I][22.548]: Expression: Sad |
| 175 | +[Expressive Eyes Example/I][33.168]: Expression: Angry |
| 176 | +[Expressive Eyes Example/I][43.788]: Expression: Surprised |
| 177 | +[Expressive Eyes Example/I][54.407]: Testing look_at functionality |
| 178 | +[Expressive Eyes Example/I][54.408]: Looking left |
| 179 | +[Expressive Eyes Example/I][59.717]: Looking right |
| 180 | +[Expressive Eyes Example/I][65.028]: Looking up |
| 181 | +[Expressive Eyes Example/I][70.337]: Looking down |
| 182 | +[Expressive Eyes Example/I][75.648]: Looking center |
| 183 | +[Expressive Eyes Example/I][80.957]: Starting random demo mode - will run continuously |
| 184 | +``` |
0 commit comments