2 次程式碼提交

作者 SHA1 備註 提交日期
  The Dod 1343a2ce63 Always show embroydery bg 10 月之前
  The Dod 9995882462 Version with bg (only when sending metta) 10 月之前
共有 11 個檔案被更改,包括 6150 行新增38 行删除
  1. 1
    0
      .gitignore
  2. 二進制
      graphics/peace/bg-salam.png
  3. 二進制
      graphics/peace/bg-shalom.png
  4. 二進制
      graphics/peace/salambg.png
  5. 二進制
      graphics/peace/shalombg.png
  6. 二進制
      graphics/peace/togetherbg.png
  7. 0
    12
      talismetta/config.h
  8. 2042
    0
      talismetta/salambg.h
  9. 2042
    0
      talismetta/shalombg.h
  10. 23
    26
      talismetta/talismetta.ino
  11. 2042
    0
      talismetta/togetherbg.h

+ 1
- 0
.gitignore 查看文件

@@ -1,5 +1,6 @@
1 1
 *.backup
2 2
 *.swp
3 3
 *.tmp
4
+talismetta/config.h
4 5
 work/
5 6
 

二進制
graphics/peace/bg-salam.png 查看文件


二進制
graphics/peace/bg-shalom.png 查看文件


二進制
graphics/peace/salambg.png 查看文件


二進制
graphics/peace/shalombg.png 查看文件


二進制
graphics/peace/togetherbg.png 查看文件


+ 0
- 12
talismetta/config.h 查看文件

@@ -1,12 +0,0 @@
1
-#define DEBUG true
2
-
3
-// [If you haven't done so already] copy config-example.h to config.h
4
-
5
-// When DEBUG is true, board's MAC address is printed to serial
6
-// Once you copy MAC addresses of both mates, use them as YIN/YANG below.
7
-// You can then upload the same code to both mates (each would know to
8
-// scan for the other one, and not for itself).
9
-
10
-
11
-#define SHALOM "30:C6:F7:1D:A6:20"
12
-#define SALAM "30:C6:F7:1D:A2:5C"

+ 2042
- 0
talismetta/salambg.h
文件差異過大導致無法顯示
查看文件


+ 2042
- 0
talismetta/shalombg.h
文件差異過大導致無法顯示
查看文件


+ 23
- 26
talismetta/talismetta.ino 查看文件

@@ -2,11 +2,11 @@
2 2
 #include <esp_now.h>
3 3
 #include <TFT_eSPI.h>
4 4
 #include "config.h"
5
-#include "shalomorph.h"
6
-#include "shalom.h"
7
-#include "salam.h"
8
-#include "salamorph.h"
9
-#include "together.h"
5
+//#include "shalom.h"
6
+#include "shalombg.h"
7
+//#include "salam.h"
8
+#include "salambg.h"
9
+#include "togetherbg.h"
10 10
 #include "talis.h"
11 11
 #include "metta.h"
12 12
 #include "loving.h"
@@ -14,7 +14,7 @@
14 14
 #include "mybird.h"
15 15
 #include "yourbird.h"
16 16
 
17
-#define DEBUG true
17
+#define DEBUG false // note: it's easier to read the MAC address if DEBUG is false
18 18
 
19 19
 #define BUTTON1PIN ((gpio_num_t)35)
20 20
 #define BUTTON2PIN ((gpio_num_t)0)
@@ -63,41 +63,37 @@ esp_now_peer_info_t peerInfo;
63 63
 bool nearby = false;
64 64
 
65 65
 
66
-#define NUM_FRAMES 23
66
+#define NUM_FRAMES 9
67 67
 enum frameType {
68 68
   FRAME_ME,
69
-  FRAME_ME2US,
70 69
   FRAME_US,
71
-  FRAME_US2U,
72 70
   FRAME_U
73 71
 };
74 72
 
75 73
 frameType frames[NUM_FRAMES] = {
76
-  FRAME_ME, FRAME_ME2US, FRAME_US, FRAME_US2U, FRAME_U, FRAME_U, FRAME_U,
77
-  FRAME_US2U,  FRAME_US, FRAME_US,  FRAME_US2U, FRAME_U, FRAME_U, FRAME_U,
78
-  FRAME_US2U, FRAME_US, FRAME_ME2US, FRAME_ME, FRAME_ME, FRAME_ME,
79
-  FRAME_ME, FRAME_ME, FRAME_ME
74
+  FRAME_ME, FRAME_US, FRAME_U,
75
+  FRAME_U, FRAME_US, FRAME_U,
76
+  FRAME_U, FRAME_US, FRAME_ME
80 77
 };
81 78
 
82
-const unsigned short *frame2image(frameType frame, bool is_salam) {
79
+const unsigned short *frame2image(frameType frame, bool is_salam, bool metta_from_me, bool metta_from_you) {
80
+  if (!metta_from_me || !metta_from_you) {
81
+    return is_salam ? salambg : shalombg;
82
+  }
83 83
   switch (frame) {
84 84
     case FRAME_ME:
85
-      return is_salam ? salam : shalom;
86
-    case FRAME_ME2US:
87
-      return is_salam ? salamorph : shalomorph;
85
+      return is_salam ? salambg : shalombg;
88 86
     case FRAME_US:
89
-      return together;
90
-    case FRAME_US2U:
91
-      return is_salam ? shalomorph : salamorph;
87
+      return togetherbg;
92 88
     case FRAME_U:
93
-      return is_salam ? shalom : salam;
89
+      return is_salam ? shalombg  : salambg;
94 90
   }
95 91
 }
96 92
 
97 93
 int current_frame = 0;
98 94
 unsigned long last_flip = 0;
99 95
 
100
-#define DURATION 100
96
+#define DURATION 250
101 97
 
102 98
 
103 99
 TFT_eSPI tft = TFT_eSPI();
@@ -266,14 +262,15 @@ void loop() {
266 262
   // FRAME_ME or animation frame
267 263
   background.pushImage(
268 264
     0, 0, 240, 135,
269
-    frame2image((metta_from_me_since && metta_from_you) ? frames[current_frame] : FRAME_ME, is_salam));
265
+    frame2image(frames[current_frame], is_salam, metta_from_me_since, metta_from_you));
270 266
 
271
-  // mybird
272
-  if (metta_from_me_since) {
267
+  // mybird (steady, pulse if metta_from_me_Since)
268
+  if (!metta_from_me_since || frames[current_frame] == FRAME_ME) {
273 269
     mybirdSprite.pushToSprite(&background, MYBIRD_X, MYBIRD_Y, TFT_BLACK);
274 270
   }
275 271
 
276
-  if (nearby && frames[current_frame] == FRAME_U) {
272
+  // yourbird (steady if nearby, heart beat if metta_from_you)
273
+  if (nearby && (!metta_from_you || frames[current_frame] == FRAME_U)) {
277 274
     yourbirdSprite.pushToSprite(&background, YOURBIRD_X, YOURBIRD_Y, TFT_BLACK);
278 275
   }
279 276
 

+ 2042
- 0
talismetta/togetherbg.h
文件差異過大導致無法顯示
查看文件


Loading…
取消
儲存