Przeglądaj źródła

Always show embroydery bg

Also:

* New backgrounds (scanned without the hardware)
* Add `config.h` to .gitignore (we have `config_example.h`)
master
The Dod 3 miesięcy temu
rodzic
commit
1343a2ce63

+ 1
- 0
.gitignore Wyświetl plik

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

BIN
graphics/peace/bg-salam-darkened.png Wyświetl plik


BIN
graphics/peace/bg-salam.png Wyświetl plik


BIN
graphics/peace/bg-shalom-darkened.png Wyświetl plik


BIN
graphics/peace/bg-shalom.png Wyświetl plik


BIN
graphics/peace/salambg.png Wyświetl plik


BIN
graphics/peace/shalombg.png Wyświetl plik


BIN
graphics/peace/togetherbg.png Wyświetl plik


+ 0
- 12
talismetta/config.h Wyświetl plik

@@ -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 "08:F9:E0:D1:28:4C"
12
-#define SALAM "30:C6:F7:1D:A2:5C"

+ 1977
- 1977
talismetta/salambg.h
Plik diff jest za duży
Wyświetl plik


+ 1989
- 1989
talismetta/shalombg.h
Plik diff jest za duży
Wyświetl plik


+ 13
- 18
talismetta/talismetta.ino Wyświetl plik

@@ -2,9 +2,9 @@
2 2
 #include <esp_now.h>
3 3
 #include <TFT_eSPI.h>
4 4
 #include "config.h"
5
-#include "shalom.h"
5
+//#include "shalom.h"
6 6
 #include "shalombg.h"
7
-#include "salam.h"
7
+//#include "salam.h"
8 8
 #include "salambg.h"
9 9
 #include "togetherbg.h"
10 10
 #include "talis.h"
@@ -77,21 +77,16 @@ frameType frames[NUM_FRAMES] = {
77 77
 };
78 78
 
79 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) {
80
+  if (!metta_from_me || !metta_from_you) {
81
+    return is_salam ? salambg : shalombg;
82
+  }
83
+  switch (frame) {
84
+    case FRAME_ME:
82 85
       return is_salam ? salambg : shalombg;
83
-    } else {
84
-      return is_salam ? salam : shalom;
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
-    }
86
+    case FRAME_US:
87
+      return togetherbg;
88
+    case FRAME_U:
89
+      return is_salam ? shalombg  : salambg;
95 90
   }
96 91
 }
97 92
 
@@ -270,12 +265,12 @@ void loop() {
270 265
     frame2image(frames[current_frame], is_salam, metta_from_me_since, metta_from_you));
271 266
 
272 267
   // mybird (steady, pulse if metta_from_me_Since)
273
-  if (!metta_from_me_since || frames[current_frame] == FRAME_ME || frames[current_frame] == FRAME_US) {
268
+  if (!metta_from_me_since || frames[current_frame] == FRAME_ME) {
274 269
     mybirdSprite.pushToSprite(&background, MYBIRD_X, MYBIRD_Y, TFT_BLACK);
275 270
   }
276 271
 
277 272
   // 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)) {
273
+  if (nearby && (!metta_from_you || frames[current_frame] == FRAME_U)) {
279 274
     yourbirdSprite.pushToSprite(&background, YOURBIRD_X, YOURBIRD_Y, TFT_BLACK);
280 275
   }
281 276
 

+ 1991
- 1991
talismetta/togetherbg.h
Plik diff jest za duży
Wyświetl plik


Ładowanie…
Anuluj
Zapisz