macsbug

Wio Electronic Animated Eyes

leave a comment »

Wioで 電子アニメーションの目 を表示しました。         2020.05.26

機能:
_ 5 Way Swicth:LEFT :左目のウインク
_ 5 Way Swicth:Center:両目のブリンク
_ 5 Way Swicth:RIGHT :右目のウインク
_ 注意:5 Way Swicth は 押し具合が不安定です。


.
スケッチ:Wio_uncannyEyes.zip を DL してください。
_ DL 後に Wio_uncannyEyes.zip_.pdf の末尾 _.pdf を消し
_ Wio_uncannyEyes.zip を解凍します。
_ フォルダーの中味は 以下です。
_ 


.
Electronic Animated Eyes について。
1. 原作は adafruit の Electronic Animated Eyes using Teensy 3.1/3.2 です。
2. これから Bodmer氏が TFT_eSPI で ESP8266_uncannyEyes を作成。
_ Bodmer氏に感謝致します。
3. ESP866_uncannyEyes を M5Stack(両目) と M5StickC(片目) に移植。
4. さらに Wio Terminal へ移植しました。


.
移植:
_ 移植の詳細は 以下を参照ください。
_ 2019.05.06:M5Stack Electronic Animated Eyes: M5Stackで Eyes
_ 2019.05.08:M5StickC Electronic Animated Eyes:M5StickCで Eyes


.
目の種類:

defaultEye
noScleraEye dragonEye goatEye
catEye newtEye terminatorEye
naugaEye newtEye owlEye

 

目の選択:使用するデーターを選択します。例:#include “defaultEye.h”

// Enable ONE of these #includes for the various eyes:
#include "defaultEye.h"     // Standard human-ish hazel eye
//#include "noScleraEye.h"  // Large iris, no sclera
//#include "dragonEye.h"    // Slit pupil fiery dragon// -0x001 to 0x007F
//#include "goatEye.h"      // Horizontal pupil goat  // -0x001 to 0x007F
//#include "catEye.h"       // #include <pgmspace.h>,][ to *,= to PROGMEM=
//#include "doeEye.h"       // #include <pgmspace.h>,][ to *,= to PROGMEM=
//#include "terminatorEye.h"// #include <pgmspace.h>,][ to *,= to PROGMEM=
//#include "naugaEye.h"     // #include <pgmspace.h>,][ to *,= to PROGMEM=
//#include "newtEye.h"      // #include <pgmspace.h>,][ to *,= to PROGMEM=
//#include "owlEye.h"       // #include <pgmspace.h>,][ to *,= to PROGMEM=

 


.
操作と設定:
_ 例:#define WINK_L_PIN:WIO_5S_LEFT。左目のウインクは SW の LFET。

#define DISPLAY_DC       D3 // Data/command pin for BOTH displays
#define DISPLAY_RESET    D4 // Reset pin for BOTH displays
#define SELECT_L_PIN     WIO_KEY_C // LEFT  eye chip select pin
#define SELECT_R_PIN     WIO_KEY_A // RIGHT eye chip select pin
// INPUT CONFIG (for eye motion -- enable or comment out as needed) -------
// The ESP8266 is rather constrained here as it only has one analogue port.
// An I2C ADC could be used for more analogue channels
//#define JOYSTICK_X_PIN A0 // Analog pin for eye horiz pos (else auto)
//#define JOYSTICK_Y_PIN A0 // Analog pin for eye vert position (")
//#define JOYSTICK_X_FLIP   // If set, reverse stick X axis
//#define JOYSTICK_Y_FLIP   // If set, reverse stick Y axis
#define TRACKING         // If enabled, eyelid tracks pupil
#define IRIS_PIN         WIO_5S_PRESS // Photocell or potentiometer (else auto iris)
#define IRIS_PIN_FLIP    WIO_5S_PRESS // If set, reverse reading from dial/photocell
#define IRIS_SMOOTH      // If enabled, filter input from IRIS_PIN
#define IRIS_MIN         140 // Clip lower analogRead() range from IRIS_PIN
#define IRIS_MAX         260 // Clip upper "
#define WINK_L_PIN       WIO_5S_LEFT  // Pin for LEFT eye wink button
#define BLINK_PIN        WIO_5S_PRESS // in for blink button (BOTH eyes)
#define WINK_R_PIN       WIO_5S_RIGHT // Pin for RIGHT eye wink button
#define AUTOBLINK        // If enabled, eyes blink autonomously
//-----------------------------------// BUTTON &amp; 5 Way Swicth ---
 pinMode(WIO_KEY_A,    INPUT_PULLUP); // RIGHT
 pinMode(WIO_KEY_B,    INPUT_PULLUP); // CENTER
 pinMode(WIO_KEY_C,    INPUT_PULLUP); // LEFT
 pinMode(WIO_5S_UP,    INPUT_PULLUP); // 
 pinMode(WIO_5S_DOWM,  INPUT_PULLUP); // 
 pinMode(WIO_5S_LEFT,  INPUT_PULLUP); // 
 pinMode(WIO_5S_RIGHT, INPUT_PULLUP); // 
 pinMode(WIO_5S_PRESS, INPUT_PULLUP); // 

.
感想:
Wio の Display は 画像が綺麗に引き立ちます。
操作部分を熟知し他のセンサーと接続すると応用できるかと思います。
画像の抽画は pushColors 命令を使用しています。


Wio , Terminal , Wio_uncannyEyes , Electronic Animated Eyes , Wio Electronic Animated Eyes

Written by macsbug

5月 26, 2020 @ 5:15 pm

カテゴリー: Wio Terminal

コメントを残す