2 次代码提交

作者 SHA1 备注 提交日期
  The Dod 1343a2ce63 Always show embroydery bg 1年前
  The Dod 9995882462 Version with bg (only when sending metta) 1年前
共有 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
 *.backup
1
 *.backup
2
 *.swp
2
 *.swp
3
 *.tmp
3
 *.tmp
4
+talismetta/config.h
4
 work/
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
-#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
 #include <esp_now.h>
2
 #include <esp_now.h>
3
 #include <TFT_eSPI.h>
3
 #include <TFT_eSPI.h>
4
 #include "config.h"
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
 #include "talis.h"
10
 #include "talis.h"
11
 #include "metta.h"
11
 #include "metta.h"
12
 #include "loving.h"
12
 #include "loving.h"
14
 #include "mybird.h"
14
 #include "mybird.h"
15
 #include "yourbird.h"
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
 #define BUTTON1PIN ((gpio_num_t)35)
19
 #define BUTTON1PIN ((gpio_num_t)35)
20
 #define BUTTON2PIN ((gpio_num_t)0)
20
 #define BUTTON2PIN ((gpio_num_t)0)
63
 bool nearby = false;
63
 bool nearby = false;
64
 
64
 
65
 
65
 
66
-#define NUM_FRAMES 23
66
+#define NUM_FRAMES 9
67
 enum frameType {
67
 enum frameType {
68
   FRAME_ME,
68
   FRAME_ME,
69
-  FRAME_ME2US,
70
   FRAME_US,
69
   FRAME_US,
71
-  FRAME_US2U,
72
   FRAME_U
70
   FRAME_U
73
 };
71
 };
74
 
72
 
75
 frameType frames[NUM_FRAMES] = {
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
   switch (frame) {
83
   switch (frame) {
84
     case FRAME_ME:
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
     case FRAME_US:
86
     case FRAME_US:
89
-      return together;
90
-    case FRAME_US2U:
91
-      return is_salam ? shalomorph : salamorph;
87
+      return togetherbg;
92
     case FRAME_U:
88
     case FRAME_U:
93
-      return is_salam ? shalom : salam;
89
+      return is_salam ? shalombg  : salambg;
94
   }
90
   }
95
 }
91
 }
96
 
92
 
97
 int current_frame = 0;
93
 int current_frame = 0;
98
 unsigned long last_flip = 0;
94
 unsigned long last_flip = 0;
99
 
95
 
100
-#define DURATION 100
96
+#define DURATION 250
101
 
97
 
102
 
98
 
103
 TFT_eSPI tft = TFT_eSPI();
99
 TFT_eSPI tft = TFT_eSPI();
266
   // FRAME_ME or animation frame
262
   // FRAME_ME or animation frame
267
   background.pushImage(
263
   background.pushImage(
268
     0, 0, 240, 135,
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
     mybirdSprite.pushToSprite(&background, MYBIRD_X, MYBIRD_Y, TFT_BLACK);
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
     yourbirdSprite.pushToSprite(&background, YOURBIRD_X, YOURBIRD_Y, TFT_BLACK);
274
     yourbirdSprite.pushToSprite(&background, YOURBIRD_X, YOURBIRD_Y, TFT_BLACK);
278
   }
275
   }
279
 
276
 

+ 2042
- 0
talismetta/togetherbg.h
文件差异内容过多而无法显示
查看文件


正在加载...
取消
保存