Browse Source

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 months ago
parent
commit
1343a2ce63

+ 1
- 0
.gitignore View File

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

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


+ 0
- 12
talismetta/config.h View File

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
File diff suppressed because it is too large
View File


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


+ 13
- 18
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 "shalom.h"
5
+//#include "shalom.h"
6
 #include "shalombg.h"
6
 #include "shalombg.h"
7
-#include "salam.h"
7
+//#include "salam.h"
8
 #include "salambg.h"
8
 #include "salambg.h"
9
 #include "togetherbg.h"
9
 #include "togetherbg.h"
10
 #include "talis.h"
10
 #include "talis.h"
77
 };
77
 };
78
 
78
 
79
 const unsigned short *frame2image(frameType frame, bool is_salam, bool metta_from_me, bool metta_from_you) {
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
       return is_salam ? salambg : shalombg;
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
     frame2image(frames[current_frame], is_salam, metta_from_me_since, metta_from_you));
265
     frame2image(frames[current_frame], is_salam, metta_from_me_since, metta_from_you));
271
 
266
 
272
   // mybird (steady, pulse if metta_from_me_Since)
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
     mybirdSprite.pushToSprite(&background, MYBIRD_X, MYBIRD_Y, TFT_BLACK);
269
     mybirdSprite.pushToSprite(&background, MYBIRD_X, MYBIRD_Y, TFT_BLACK);
275
   }
270
   }
276
 
271
 
277
   // yourbird (steady if nearby, heart beat if metta_from_you)
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
     yourbirdSprite.pushToSprite(&background, YOURBIRD_X, YOURBIRD_Y, TFT_BLACK);
274
     yourbirdSprite.pushToSprite(&background, YOURBIRD_X, YOURBIRD_Y, TFT_BLACK);
280
   }
275
   }
281
 
276
 

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


Loading…
Cancel
Save