Browse Source

Version with bg (only when sending metta)

master
The Dod 1 month ago
parent
commit
9995882462

BIN
graphics/peace/bg-salam-darkened.png View File


BIN
graphics/peace/bg-salam.png View File


BIN
graphics/peace/bg-shalom-darkened.png View File


BIN
graphics/peace/bg-shalom.png View File


BIN
graphics/peace/salambg.png View File


BIN
graphics/peace/shalombg.png View File


BIN
graphics/peace/togetherbg.png View File


+ 1
- 1
talismetta/config.h View File

8
 // scan for the other one, and not for itself).
8
 // scan for the other one, and not for itself).
9
 
9
 
10
 
10
 
11
-#define SHALOM "30:C6:F7:1D:A6:20"
11
+#define SHALOM "08:F9:E0:D1:28:4C"
12
 #define SALAM "30:C6:F7:1D:A2:5C"
12
 #define SALAM "30:C6:F7:1D:A2:5C"

+ 2042
- 0
talismetta/salambg.h
File diff suppressed because it is too large
View File


+ 2042
- 0
talismetta/shalombg.h
File diff suppressed because it is too large
View File


+ 29
- 27
talismetta/talismetta.ino View File

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"
5
 #include "shalom.h"
6
+#include "shalombg.h"
7
 #include "salam.h"
7
 #include "salam.h"
8
-#include "salamorph.h"
9
-#include "together.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) {
83
-  switch (frame) {
84
-    case FRAME_ME:
79
+const unsigned short *frame2image(frameType frame, bool is_salam, bool metta_from_me, bool metta_from_you) {
80
+  if (!metta_from_you) {
81
+    if (metta_from_me) {
82
+      return is_salam ? salambg : shalombg;
83
+    } else {
85
       return is_salam ? salam : shalom;
84
       return is_salam ? salam : shalom;
86
-    case FRAME_ME2US:
87
-      return is_salam ? salamorph : shalomorph;
88
-    case FRAME_US:
89
-      return together;
90
-    case FRAME_US2U:
91
-      return is_salam ? shalomorph : salamorph;
92
-    case FRAME_U:
93
-      return is_salam ? shalom : salam;
85
+    }
86
+  } else { // metta_from_you
87
+    switch (frame) {
88
+      case FRAME_ME:
89
+        return metta_from_me ? (is_salam ? salambg : shalombg) : (is_salam ? salam : shalom);
90
+      case FRAME_US:
91
+        return metta_from_me ? togetherbg : (is_salam ? salam : shalom);
92
+      case FRAME_U:
93
+        return (metta_from_me) ? (is_salam ? shalombg  : salambg) : (is_salam ?  salam : shalom);
94
+    }
94
   }
95
   }
95
 }
96
 }
96
 
97
 
97
 int current_frame = 0;
98
 int current_frame = 0;
98
 unsigned long last_flip = 0;
99
 unsigned long last_flip = 0;
99
 
100
 
100
-#define DURATION 100
101
+#define DURATION 250
101
 
102
 
102
 
103
 
103
 TFT_eSPI tft = TFT_eSPI();
104
 TFT_eSPI tft = TFT_eSPI();
266
   // FRAME_ME or animation frame
267
   // FRAME_ME or animation frame
267
   background.pushImage(
268
   background.pushImage(
268
     0, 0, 240, 135,
269
     0, 0, 240, 135,
269
-    frame2image((metta_from_me_since && metta_from_you) ? frames[current_frame] : FRAME_ME, is_salam));
270
+    frame2image(frames[current_frame], is_salam, metta_from_me_since, metta_from_you));
270
 
271
 
271
-  // mybird
272
-  if (metta_from_me_since) {
272
+  // mybird (steady, pulse if metta_from_me_Since)
273
+  if (!metta_from_me_since || frames[current_frame] == FRAME_ME || frames[current_frame] == FRAME_US) {
273
     mybirdSprite.pushToSprite(&background, MYBIRD_X, MYBIRD_Y, TFT_BLACK);
274
     mybirdSprite.pushToSprite(&background, MYBIRD_X, MYBIRD_Y, TFT_BLACK);
274
   }
275
   }
275
 
276
 
276
-  if (nearby && frames[current_frame] == FRAME_U) {
277
+  // yourbird (steady if nearby, heart beat if metta_from_you)
278
+  if (nearby && (!metta_from_you || frames[current_frame] == FRAME_U || frames[current_frame] == FRAME_US)) {
277
     yourbirdSprite.pushToSprite(&background, YOURBIRD_X, YOURBIRD_Y, TFT_BLACK);
279
     yourbirdSprite.pushToSprite(&background, YOURBIRD_X, YOURBIRD_Y, TFT_BLACK);
278
   }
280
   }
279
 
281
 

+ 2042
- 0
talismetta/togetherbg.h
File diff suppressed because it is too large
View File


Loading…
Cancel
Save