Compare commits
28 Commits
7ee85cd4f4
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b9f0c632d1 | |||
| 74d7354593 | |||
| c996650414 | |||
| 653257b787 | |||
| 15e79e67df | |||
| a58f11ac0e | |||
| 56d4b8c371 | |||
| 3d14ba3dd6 | |||
| 1dd5117e1f | |||
| e784983f99 | |||
| b60b02e223 | |||
| 1bcb39820c | |||
| 573f300fea | |||
| 0f9dc7a886 | |||
| a48c3ab596 | |||
| df590dbf19 | |||
| 7ce521fb89 | |||
| 5d0764988f | |||
| c9c0dd14b5 | |||
| 581fcd8c85 | |||
| f9da3a45f0 | |||
| 63defcc7c7 | |||
| 46438103b3 | |||
| e2c41f0360 | |||
| 054f92aa18 | |||
| 7ccb745daf | |||
| 1505801985 | |||
| 6120e3dc14 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
audio
|
audio
|
||||||
videos
|
videos
|
||||||
images
|
images
|
||||||
|
__pycache__
|
||||||
3
Pipfile
3
Pipfile
@@ -4,12 +4,11 @@ verify_ssl = true
|
|||||||
name = "pypi"
|
name = "pypi"
|
||||||
|
|
||||||
[packages]
|
[packages]
|
||||||
python-vlc = "*"
|
|
||||||
opencv-python = "*"
|
opencv-python = "*"
|
||||||
screeninfo = "*"
|
screeninfo = "*"
|
||||||
serial = "*"
|
|
||||||
paho-mqtt = "*"
|
paho-mqtt = "*"
|
||||||
startspimage = "*"
|
startspimage = "*"
|
||||||
|
pygame = "*"
|
||||||
|
|
||||||
[dev-packages]
|
[dev-packages]
|
||||||
|
|
||||||
|
|||||||
130
Pipfile.lock
generated
130
Pipfile.lock
generated
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"hash": {
|
"hash": {
|
||||||
"sha256": "ed6f5adc48a375df01b39e00b0c026dd3add47599e4fc4e05bb75513cace77d1"
|
"sha256": "3ead243ae65c4b2814edf7b7a1973caef775cf0d69385003ca32e07485694a39"
|
||||||
},
|
},
|
||||||
"pipfile-spec": 6,
|
"pipfile-spec": 6,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -16,21 +16,6 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"default": {
|
"default": {
|
||||||
"future": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"
|
|
||||||
],
|
|
||||||
"markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
|
||||||
"version": "==0.18.2"
|
|
||||||
},
|
|
||||||
"iso8601": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:27f503220e6845d9db954fb212b95b0362d8b7e6c1b2326a87061c3de93594b1",
|
|
||||||
"sha256:d7bc01b1c2a43b259570bb307f057abc578786ea734ba2b87b836c5efc5bd443"
|
|
||||||
],
|
|
||||||
"markers": "python_full_version >= '3.6.2' and python_full_version < '4.0.0'",
|
|
||||||
"version": "==1.0.2"
|
|
||||||
},
|
|
||||||
"numpy": {
|
"numpy": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:1408c3527a74a0209c781ac82bde2182b0f0bf54dea6e6a363fe0cc4488a7ce7",
|
"sha256:1408c3527a74a0209c781ac82bde2182b0f0bf54dea6e6a363fe0cc4488a7ce7",
|
||||||
@@ -56,7 +41,7 @@
|
|||||||
"sha256:d748ef349bfef2e1194b59da37ed5a29c19ea8d7e6342019921ba2ba4fd8b624",
|
"sha256:d748ef349bfef2e1194b59da37ed5a29c19ea8d7e6342019921ba2ba4fd8b624",
|
||||||
"sha256:e0d7447679ae9a7124385ccf0ea990bb85bb869cef217e2ea6c844b6a6855073"
|
"sha256:e0d7447679ae9a7124385ccf0ea990bb85bb869cef217e2ea6c844b6a6855073"
|
||||||
],
|
],
|
||||||
"markers": "python_version >= '3.7'",
|
"markers": "python_version >= '3.10'",
|
||||||
"version": "==1.23.1"
|
"version": "==1.23.1"
|
||||||
},
|
},
|
||||||
"opencv-python": {
|
"opencv-python": {
|
||||||
@@ -143,52 +128,69 @@
|
|||||||
"markers": "python_version >= '3.7'",
|
"markers": "python_version >= '3.7'",
|
||||||
"version": "==9.2.0"
|
"version": "==9.2.0"
|
||||||
},
|
},
|
||||||
"python-vlc": {
|
"pygame": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:92f98fee088f72bd6d063b3b3312d0bd29b37e7ad65ddeb3a7303320300c2807",
|
"sha256:0427c103f741234336e5606d2fad86f5403c1a3d1dc55c309fbff3c984f0c9ae",
|
||||||
"sha256:c409afb38fe9f788a663b4302ca583f31289ef0860ab2b1668da96bbe8f14bfc"
|
"sha256:07ca9f683075aea9bd977af9f09a720ebf747343d3ea8103e4f1735283b02330",
|
||||||
|
"sha256:0e06ae8e1c830f1b9c36a2bc6bb11de840232e95b78e2c349c6ed803a303be19",
|
||||||
|
"sha256:0e97d38308c441942577fea7fcd1326308bc56d6be6c024218e94d075d322e0f",
|
||||||
|
"sha256:119dee20c372c85dc47b717119534d15a60c64ceab8b0eb09278866d10486afe",
|
||||||
|
"sha256:1219a963941bd53aa754e8449364c142004fe706c33a9c22ff2a76521a82d078",
|
||||||
|
"sha256:1fddec8829e96424800c806582d73a5173b7d48946cccf7d035839ca09850db8",
|
||||||
|
"sha256:20676da24e3e3e6b9fc4eecc7ba09d77ef46c3a83a028763ba1d222476c2e3fb",
|
||||||
|
"sha256:2405414d8c572668e04739875661e030a0c588e197fa95463fe301c3d0a0510b",
|
||||||
|
"sha256:24254c4244f0d9bdc904f5d3f38e86757ca4c6aa0e44a6d55ef5e016bc7274d6",
|
||||||
|
"sha256:24b4f7f30fa2b3d092b60be6fcc725fb91d569fc87a9bcc91614ee8b0c005726",
|
||||||
|
"sha256:3bb0674aa789848ddc264bfc60c54965bf3bb659c141de4f600e379acc9b944c",
|
||||||
|
"sha256:3c8d6637ff75351e581327efefa9d04eeb0f257b533392b6cc6b15ceca4f7c5e",
|
||||||
|
"sha256:40e4d8d65985bb467d9c5a1305fb53fd6820c61d764979600becab973339676f",
|
||||||
|
"sha256:4aa3ae32320cc704d63e185864e44f6265c2a6e52c9384afe152cc3d51b3a2ef",
|
||||||
|
"sha256:50d9a21edd551669862c27c9272747401b20b1939abaacb842c08ea1cdd1c04d",
|
||||||
|
"sha256:5c7600bf307de1ca1dca0cc7840e34604d5b0b0a5a5dad345c3fa62b054b886d",
|
||||||
|
"sha256:5d0c14152d0ca8ef5fbcc5ed9981462bdf59a9ae85a291e62d8a8d0b7e5cbe43",
|
||||||
|
"sha256:5e88b0d4338b94960686f59396f23f7f684fed4859fcc3b9f40286d72c1c61af",
|
||||||
|
"sha256:5ebbefb8b576572c8fc97a3321d37dc2b4afea6b6e3877a67f7158d8c2c4cefe",
|
||||||
|
"sha256:636f51f56615d67459b11918206bb4da30cd7d7042027bf997c218ccd6c77902",
|
||||||
|
"sha256:660c80c0b2e80f1f801715583b759fb4c7bc0c11eb3b534e89c9fc4bfbc38acd",
|
||||||
|
"sha256:6ecda8dd4583982bb65f9c682f244a5e94524dcf628379766227e9ed97201a49",
|
||||||
|
"sha256:754c2906f2ef47173a14493e1de116b2a56a2c8e1764f1202ba844d080248a5b",
|
||||||
|
"sha256:7889dce887ec83c9a0bef8d9eb3669d8863fdaf37c45bacec707d8ad90b24a38",
|
||||||
|
"sha256:7fdb93b4282962c9a2ebf1af994ee698be823dd913218ed97a5f2fb372b10b66",
|
||||||
|
"sha256:8e87716114e97322fb177e223d889a4be369a0f73212f4f8507fe0cd43253b23",
|
||||||
|
"sha256:93c4cbfc942dd00410eaa9e84252129f9f9993f37f683006d7b49ab245342254",
|
||||||
|
"sha256:9649419254d3282dae41f23837de4108b17bc62187c3acd8af2ae3801b765cbd",
|
||||||
|
"sha256:97a74ba186deee68318a52637012ef6abf5be6282c659e1d1ba6ad08cf35ec85",
|
||||||
|
"sha256:9d6452419e01a0f848aed0597f69fd10a4c2a7750c15d1b0607f86090a39dcf3",
|
||||||
|
"sha256:9d7b021b8dde5d528363e474bc18bd6f79a9666eef89fb4859bcb8f0a536c9de",
|
||||||
|
"sha256:a0ccf8e3dce7ca67d523a6020b7e3dbf4b26797a9a8db5cc4c7b5ef20fb64701",
|
||||||
|
"sha256:a56a811d8821f7b9a594e3d0e0dd8bd39b25e3eea8963d5963263b90fd2ea5c2",
|
||||||
|
"sha256:c5ea87da5fe4b6164c3854f3b0c9146811dbad0dd7fa74297683dfacc485ae1c",
|
||||||
|
"sha256:c99b95e62cdda29c2e60235d7763447c168a6a877403e6f9ca5b2e2bb297c2ce",
|
||||||
|
"sha256:c9ce7f3d8af14d7e04eb7eb41c5e5313c43508c252bb2b9eb53e51fc87ada9fd",
|
||||||
|
"sha256:ca5ef1315fa67c241a657ab077be44f230c05740c95f0b46409457dceefdc7e5",
|
||||||
|
"sha256:d2d3c50ee9847b743db6cd7b1bb17a94c2c2abc16679d70f5e745cabdf19e655",
|
||||||
|
"sha256:d6d0eca28f886f0477cd0721ac688189155a587f2bb8eae740e52ca56c3ad23c",
|
||||||
|
"sha256:dad6bf3fdd3752d7519422f3732be779b98fe7c87d32c3efe2fdffdcbeebb6ca",
|
||||||
|
"sha256:db2f40d5a75fd9cdda473c58b0d8b294da6e0179f00bb3b1fc2f7f29cac09bea",
|
||||||
|
"sha256:dc4444d61d48c5546df5137cdf81554887ddb6e2ef1be7f51eb77ea3b6bdd56f",
|
||||||
|
"sha256:dcc285ee1f1d0e2672cc52f880fd3f564b1505de710e817f692fbf64a72ca657",
|
||||||
|
"sha256:dd528dbb91eca16f7522c975d0f9e94b95f6b5024c82c3247dc0383d242d33c6",
|
||||||
|
"sha256:e09044e9e1aa8512d6a9c7ce5f94b881824bcfc401105f3c24f546dfc3bb4aa5",
|
||||||
|
"sha256:e18c9466131378421d00fc40b637425229238d506a073d9c537b230b355a25d6",
|
||||||
|
"sha256:e1bb25986db77a48f632469c6bc61baf7508ce945aa6161c02180d4ee5ac5b8d",
|
||||||
|
"sha256:e4b4cd440d50a9f8551b8989e856aab175593af07eb825cad22fd2f8f6f2ffce",
|
||||||
|
"sha256:e627300a66a90651fb39e41601d447b1fdbbfffca3f08ef0278d6cc0436b2160",
|
||||||
|
"sha256:e7a8e18677e0064b7a422f6653a622652d932826a27e50f279d55a8b122a1a83",
|
||||||
|
"sha256:e8632f6b2ddb90f6f3950744bd65d5ef15af615e3034057fa30ff836f48a7179",
|
||||||
|
"sha256:ea36f4f93524554a35cac2359df63b50af6556ed866830aa1f07f0d8580280ea",
|
||||||
|
"sha256:f149e182d0eeef15d8a9b4c9dad1b87dc6eba3a99bd3c44a777a3a2b053a3dca",
|
||||||
|
"sha256:fc2e5db54491e8f27785fc5204c96f540d3557dcf5b0a9a857b6594d6b32561b",
|
||||||
|
"sha256:fc30e834f65b893d1b4c230070183bf98e6b70c41c1511687e8436a33d5ce49d",
|
||||||
|
"sha256:fcc9586e17875c0cdf8764597955f9daa979098fd4f80be07ed68276ac225480",
|
||||||
|
"sha256:ff961c3280d6ee5f4163f4772f963d7a4dbe42e36c6dd54b79ad436c1f046e5d"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==3.0.16120"
|
"version": "==2.1.2"
|
||||||
},
|
|
||||||
"pyyaml": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293",
|
|
||||||
"sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b",
|
|
||||||
"sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57",
|
|
||||||
"sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b",
|
|
||||||
"sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4",
|
|
||||||
"sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07",
|
|
||||||
"sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba",
|
|
||||||
"sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9",
|
|
||||||
"sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287",
|
|
||||||
"sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513",
|
|
||||||
"sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0",
|
|
||||||
"sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0",
|
|
||||||
"sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92",
|
|
||||||
"sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f",
|
|
||||||
"sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2",
|
|
||||||
"sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc",
|
|
||||||
"sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c",
|
|
||||||
"sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86",
|
|
||||||
"sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4",
|
|
||||||
"sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c",
|
|
||||||
"sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34",
|
|
||||||
"sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b",
|
|
||||||
"sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c",
|
|
||||||
"sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb",
|
|
||||||
"sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737",
|
|
||||||
"sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3",
|
|
||||||
"sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d",
|
|
||||||
"sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53",
|
|
||||||
"sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78",
|
|
||||||
"sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803",
|
|
||||||
"sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a",
|
|
||||||
"sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174",
|
|
||||||
"sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"
|
|
||||||
],
|
|
||||||
"markers": "python_version >= '3.6'",
|
|
||||||
"version": "==6.0"
|
|
||||||
},
|
},
|
||||||
"screeninfo": {
|
"screeninfo": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -198,14 +200,6 @@
|
|||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==0.8"
|
"version": "==0.8"
|
||||||
},
|
},
|
||||||
"serial": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:542150a127ddbf5ed2acc3a6ac4ce807cbcdae3b197acf785bbda6565c94f848",
|
|
||||||
"sha256:e887f06e07e190e39174b694eee6724e3c48bd361be1d97964caef5d5b61c73b"
|
|
||||||
],
|
|
||||||
"index": "pypi",
|
|
||||||
"version": "==0.0.97"
|
|
||||||
},
|
|
||||||
"startspimage": {
|
"startspimage": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:4f726cc244baad240dcdac4ec387211d46a2d67abe6ce60e366d87b2915acd89"
|
"sha256:4f726cc244baad240dcdac4ec387211d46a2d67abe6ce60e366d87b2915acd89"
|
||||||
|
|||||||
70
controller/main.py
Normal file
70
controller/main.py
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
from gpiozero import LED, Button
|
||||||
|
from time import sleep
|
||||||
|
import paho.mqtt.client as mqtt
|
||||||
|
|
||||||
|
red = LED(19)
|
||||||
|
blue = LED(26)
|
||||||
|
green = LED(13)
|
||||||
|
button = Button(5)
|
||||||
|
|
||||||
|
def main ():
|
||||||
|
idle = False
|
||||||
|
while True:
|
||||||
|
if not idle:
|
||||||
|
send_idle()
|
||||||
|
idle = True
|
||||||
|
sleep(5)
|
||||||
|
red.on()
|
||||||
|
send_stop()
|
||||||
|
if buttonWait():
|
||||||
|
red.off()
|
||||||
|
idle = False
|
||||||
|
playaudio()
|
||||||
|
displaytext()
|
||||||
|
sleep(5)
|
||||||
|
playaudio()
|
||||||
|
displaytext()
|
||||||
|
green.on()
|
||||||
|
printquestion()
|
||||||
|
sleep(1)
|
||||||
|
green.off()
|
||||||
|
red.off()
|
||||||
|
|
||||||
|
def buttonWait():
|
||||||
|
for i in range(500):
|
||||||
|
if button.value:
|
||||||
|
print("Button pressed")
|
||||||
|
return True
|
||||||
|
sleep(0.01)
|
||||||
|
return False
|
||||||
|
|
||||||
|
def send_idle():
|
||||||
|
print("Idle")
|
||||||
|
client = mqtt.Client()
|
||||||
|
client.connect("localhost", 1883, 60)
|
||||||
|
client.publish("slave", "idle")
|
||||||
|
|
||||||
|
def playaudio():
|
||||||
|
print("Play audio")
|
||||||
|
client = mqtt.Client()
|
||||||
|
client.connect("localhost", 1883, 60)
|
||||||
|
client.publish("slave", "audio")
|
||||||
|
|
||||||
|
|
||||||
|
def playvideo():
|
||||||
|
pass
|
||||||
|
|
||||||
|
def displaytext():
|
||||||
|
print("Display text")
|
||||||
|
|
||||||
|
def printquestion():
|
||||||
|
print("Question")
|
||||||
|
client = mqtt.Client()
|
||||||
|
client.connect("localhost", 1883, 60)
|
||||||
|
client.publish("print", "question")
|
||||||
|
|
||||||
|
def send_stop():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
main()
|
||||||
BIN
controller/press.png
Normal file
BIN
controller/press.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
printer/SilkRemington-Regular.otf
Normal file
BIN
printer/SilkRemington-Regular.otf
Normal file
Binary file not shown.
55
printer/actions.txt
Normal file
55
printer/actions.txt
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
ask a stranger for a dance
|
||||||
|
ask a stranger what their biggest fear is
|
||||||
|
smell a stranger’s hair
|
||||||
|
show off your impression of a duck
|
||||||
|
spank a consenting individual
|
||||||
|
kiss a consenting individual
|
||||||
|
reveal a secret
|
||||||
|
tell a creative story
|
||||||
|
compliment someone on their smile
|
||||||
|
hold Tanos hands
|
||||||
|
request a 20 second eye gaze
|
||||||
|
serve a drink for someone from another faction
|
||||||
|
ask a stranger for a dance
|
||||||
|
ask a stranger what their biggest fear is
|
||||||
|
smell a stranger’s hair
|
||||||
|
spank a consenting individual
|
||||||
|
kiss a consenting individualas
|
||||||
|
reveal a secret
|
||||||
|
do a handstand across the dance floor
|
||||||
|
tell a creative story
|
||||||
|
compliment someone on their smile
|
||||||
|
request a 20 second eye gaze
|
||||||
|
change character
|
||||||
|
find an animal to stroke
|
||||||
|
make an instrument out of something odd
|
||||||
|
tell a stranger that you love them
|
||||||
|
tell a stranger that you love yourself
|
||||||
|
start a game of leapfrog
|
||||||
|
hold someones hand
|
||||||
|
bow to someone respectable
|
||||||
|
embrace yo-ur spirit animal
|
||||||
|
give someone a foot massage
|
||||||
|
learn to code
|
||||||
|
warn someone of a grave danger
|
||||||
|
ask a question with no answer
|
||||||
|
be a fairy
|
||||||
|
find the snail
|
||||||
|
press any key to continue
|
||||||
|
swap an object with a stranger
|
||||||
|
go for an adventure
|
||||||
|
find sally the snail
|
||||||
|
find something furry and appreciate it
|
||||||
|
introduce two strangers to each other
|
||||||
|
nominate a stranger to be your friends
|
||||||
|
wingman someone that could use your help
|
||||||
|
give someone a shoulder rub
|
||||||
|
make it a party
|
||||||
|
serve someone a drink from another faction
|
||||||
|
run on the spot for 1 minute
|
||||||
|
find the pharoah
|
||||||
|
hug a consenting stranger
|
||||||
|
hug 3 consenting people in a row
|
||||||
|
strut around
|
||||||
|
consetually give someone a hug
|
||||||
|
tell someone they are the most beautiful person you have ever seen
|
||||||
29
printer/adverbs.txt
Normal file
29
printer/adverbs.txt
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
graciously
|
||||||
|
heroically
|
||||||
|
confidently
|
||||||
|
ferociously
|
||||||
|
happily
|
||||||
|
emotionally
|
||||||
|
spritely
|
||||||
|
majestically
|
||||||
|
boldly
|
||||||
|
brightly
|
||||||
|
cheerfully
|
||||||
|
eagerly
|
||||||
|
elegantly
|
||||||
|
gleefully
|
||||||
|
innocently
|
||||||
|
politely
|
||||||
|
powerfully
|
||||||
|
victoriously
|
||||||
|
boastfully
|
||||||
|
occasionally
|
||||||
|
casually
|
||||||
|
mysteriously
|
||||||
|
seriously
|
||||||
|
dramatically
|
||||||
|
flamboyantly
|
||||||
|
sexually
|
||||||
|
flirtatiously
|
||||||
|
awkwardly
|
||||||
|
saintly
|
||||||
BIN
printer/image.jpg
Normal file
BIN
printer/image.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 171 KiB |
BIN
printer/image2.jpg
Normal file
BIN
printer/image2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 257 KiB |
7
printer/locations.txt
Normal file
7
printer/locations.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
on the steps
|
||||||
|
outdoors
|
||||||
|
in the boiler room
|
||||||
|
by the DJ
|
||||||
|
in a dark area
|
||||||
|
in the auditorium
|
||||||
|
by a window
|
||||||
28
printer/press.py
Normal file
28
printer/press.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import StarTSPImage
|
||||||
|
from PIL import Image, ImageDraw, ImageFont, ImageOps
|
||||||
|
import textwrap
|
||||||
|
import random
|
||||||
|
|
||||||
|
im = Image.new('RGB', (500, 1600), color = 'white')
|
||||||
|
# f = ImageFont.load_default()
|
||||||
|
f = ImageFont.truetype("printer/SilkRemington-Regular.otf", 100)
|
||||||
|
txt=Image.new('L', (1600,500))
|
||||||
|
d = ImageDraw.Draw(txt)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
d.text((50, 50), "(When flashing)", font=f, fill=255)
|
||||||
|
w=txt.rotate(-90, expand=1)
|
||||||
|
|
||||||
|
im.paste( ImageOps.colorize(w, (0,0,0), (0,0,0)), (-100, 60), w)
|
||||||
|
|
||||||
|
im.show()
|
||||||
|
# im.save("image_tmp.jpg")
|
||||||
|
|
||||||
|
raster = StarTSPImage.imageToRaster(im, cut=True)
|
||||||
|
printer = open('/dev/usb/lp0', "wb")
|
||||||
|
printer.write(raster)
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import StarTSPImage
|
import StarTSPImage
|
||||||
from PIL import Image, ImageDraw
|
from PIL import Image, ImageDraw, ImageFont, ImageOps
|
||||||
|
import textwrap
|
||||||
|
import random
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -15,27 +17,68 @@ def on_connect(client, userdata, flags, rc):
|
|||||||
|
|
||||||
# The callback for when a PUBLISH message is received from the server.
|
# The callback for when a PUBLISH message is received from the server.
|
||||||
def on_message(client, userdata, msg):
|
def on_message(client, userdata, msg):
|
||||||
print(msg.topic+" "+str(msg.payload))
|
print("Print")
|
||||||
image = Image.new('RGB', (2000, 2000), color='White')
|
with open("printer/locations.txt") as locations:
|
||||||
draw = ImageDraw.Draw(image)
|
lines = locations.read().splitlines()
|
||||||
draw.ellipse((0, 0, 500, 500), fill='Black')
|
location = random.choice(lines)
|
||||||
draw.ellipse((10, 10, 490, 490), fill='White')
|
|
||||||
image.show()
|
|
||||||
image.save("image.jpg")
|
|
||||||
|
|
||||||
# raster = StarTSPImage.imageToRaster(image, cut=True)
|
with open("printer/actions.txt") as actions:
|
||||||
|
lines = actions.read().splitlines()
|
||||||
|
action = random.choice(lines)
|
||||||
|
|
||||||
|
with open("printer/adverbs.txt") as adverb:
|
||||||
|
lines = adverb.read().splitlines()
|
||||||
|
adverb = random.choice(lines)
|
||||||
|
|
||||||
|
if random.randint(0,1):
|
||||||
|
im=Image.open("printer/image.jpg")
|
||||||
|
else:
|
||||||
|
im=Image.open("printer/image2.jpg")
|
||||||
|
|
||||||
|
# f = ImageFont.load_default()
|
||||||
|
f = ImageFont.truetype("printer/SilkRemington-Regular.otf", 40)
|
||||||
|
txt=Image.new('L', (1000,230))
|
||||||
|
d = ImageDraw.Draw(txt)
|
||||||
|
|
||||||
|
text = "While {}, {}, {}".format(location, action, adverb)
|
||||||
|
text_short = "By the DJ, offer a stranger a drink"
|
||||||
|
text_long = "In the outdoor area, ask someone would you rather be known for always being honest or always being kind"
|
||||||
|
|
||||||
|
lines = textwrap.wrap(text, width=23)
|
||||||
|
|
||||||
|
if random.randint(0,1) == 0:
|
||||||
|
im=Image.open("printer/image.jpg")
|
||||||
|
else:
|
||||||
|
im=Image.open("printer/image2.jpg")
|
||||||
|
|
||||||
|
y = 0
|
||||||
|
n = 0
|
||||||
|
for line in lines:
|
||||||
|
n += 1
|
||||||
|
width, height = f.getsize(line)
|
||||||
|
d.text(((1000-width)/2, y), line, font=f, fill=255)
|
||||||
|
y += height
|
||||||
|
w=txt.rotate(-90, expand=1)
|
||||||
|
print(n)
|
||||||
|
im.paste( ImageOps.colorize(w, (0,0,0), (0,0,0)), ( (n-5)*20 + 127, 5), w)
|
||||||
|
|
||||||
|
# im.show()
|
||||||
|
# im.save("image_tmp.jpg")
|
||||||
|
|
||||||
|
raster = StarTSPImage.imageToRaster(im, cut=True)
|
||||||
|
|
||||||
|
printer = open('/dev/usb/lp0', "wb")
|
||||||
|
printer.write(raster)
|
||||||
|
|
||||||
# printer = open('/dev/usb/lp0', "wb")
|
|
||||||
# printer.write(raster)
|
|
||||||
|
|
||||||
client = mqtt.Client()
|
client = mqtt.Client()
|
||||||
client.on_connect = on_connect
|
client.on_connect = on_connect
|
||||||
client.on_message = on_message
|
client.on_message = on_message
|
||||||
|
|
||||||
client.connect("10.1.1.162", 1883, 60)
|
client.connect("192.168.240.231", 1883, 60)
|
||||||
|
|
||||||
# Blocking call that processes network traffic, dispatches callbacks and
|
# Blocking call that processes network traffic, dispatches callbacks and
|
||||||
# handles reconnecting.
|
# handles reconnecting.
|
||||||
# Other loop*() functions are available that give a threaded interface and a
|
# Other loop*() functions are available that give a threaded interface and a
|
||||||
# manual interface.
|
# manual interface.
|
||||||
client.loop_forever()
|
client.loop_forever()
|
||||||
|
|||||||
57
printer/test.py
Normal file
57
printer/test.py
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import StarTSPImage
|
||||||
|
from PIL import Image, ImageDraw, ImageFont, ImageOps
|
||||||
|
import textwrap
|
||||||
|
import random
|
||||||
|
|
||||||
|
print("Print")
|
||||||
|
with open("printer/locations.txt") as locations:
|
||||||
|
lines = locations.read().splitlines()
|
||||||
|
location = random.choice(lines)
|
||||||
|
|
||||||
|
with open("printer/actions.txt") as actions:
|
||||||
|
lines = actions.read().splitlines()
|
||||||
|
action = random.choice(lines)
|
||||||
|
|
||||||
|
with open("printer/adverbs.txt") as adverb:
|
||||||
|
lines = adverb.read().splitlines()
|
||||||
|
adverb = random.choice(lines)
|
||||||
|
|
||||||
|
if random.randint(0,1):
|
||||||
|
im=Image.open("printer/image.jpg")
|
||||||
|
else:
|
||||||
|
im=Image.open("printer/image2.jpg")
|
||||||
|
|
||||||
|
# f = ImageFont.load_default()
|
||||||
|
f = ImageFont.truetype("printer/SilkRemington-Regular.otf", 40)
|
||||||
|
txt=Image.new('L', (1000,230))
|
||||||
|
d = ImageDraw.Draw(txt)
|
||||||
|
|
||||||
|
text = "While {}, {}, {}".format(location, action, adverb)
|
||||||
|
text_short = "By the DJ, offer a stranger a drink"
|
||||||
|
text_long = "In the outdoor area, ask someone would you rather be known for always being honest or always being kind"
|
||||||
|
|
||||||
|
lines = textwrap.wrap(text, width=23)
|
||||||
|
|
||||||
|
if random.randint(0,1) == 0:
|
||||||
|
im=Image.open("printer/image.jpg")
|
||||||
|
else:
|
||||||
|
im=Image.open("printer/image2.jpg")
|
||||||
|
|
||||||
|
y = 0
|
||||||
|
n = 0
|
||||||
|
for line in lines:
|
||||||
|
n += 1
|
||||||
|
width, height = f.getsize(line)
|
||||||
|
d.text(((1000-width)/2, y), line, font=f, fill=255)
|
||||||
|
y += height
|
||||||
|
w=txt.rotate(-90, expand=1)
|
||||||
|
print(n)
|
||||||
|
im.paste( ImageOps.colorize(w, (0,0,0), (0,0,0)), ( (n-5)*20 + 127, 5), w)
|
||||||
|
|
||||||
|
# im.show()
|
||||||
|
# im.save("image_tmp.jpg")
|
||||||
|
|
||||||
|
raster = StarTSPImage.imageToRaster(im, cut=True)
|
||||||
|
|
||||||
|
printer = open('/dev/usb/lp0', "wb")
|
||||||
|
printer.write(raster)
|
||||||
22
slave/image.py
Normal file
22
slave/image.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import cv2
|
||||||
|
import numpy as np
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
class Image:
|
||||||
|
def __init__(self, x, y):
|
||||||
|
self.x = x
|
||||||
|
self.y = y
|
||||||
|
|
||||||
|
def show(self, path):
|
||||||
|
image = cv2.imread(path)
|
||||||
|
cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
|
||||||
|
cv2.moveWindow("window", self.x, self.y)
|
||||||
|
cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
|
||||||
|
cv2.imshow("window", image)
|
||||||
|
|
||||||
|
def blank(self):
|
||||||
|
blank_image = np.zeros(shape=[512, 512, 3], dtype=np.uint8)
|
||||||
|
cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
|
||||||
|
cv2.moveWindow("window", self.x, self.y)
|
||||||
|
cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
|
||||||
|
cv2.imshow("window", blank_image)
|
||||||
70
slave/main.py
Normal file
70
slave/main.py
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
|
||||||
|
# importing vlc module
|
||||||
|
from os import listdir
|
||||||
|
from os.path import isfile, join
|
||||||
|
from random import randint
|
||||||
|
from time import sleep
|
||||||
|
import paho.mqtt.client as mqtt
|
||||||
|
from video import Video
|
||||||
|
import sys
|
||||||
|
from random import randint
|
||||||
|
import cv2
|
||||||
|
from image import Image
|
||||||
|
import multiprocessing
|
||||||
|
|
||||||
|
class App:
|
||||||
|
def __init__(self, x, y):
|
||||||
|
self.x = x
|
||||||
|
self.y = y
|
||||||
|
self.video = Video(x, y)
|
||||||
|
self.image = Image(x, y)
|
||||||
|
self.videos = [join("slave/videos", f) for f in listdir("slave/videos") if isfile(join("slave/videos", f))]
|
||||||
|
self.images = [join("slave/images", f) for f in listdir("slave/images") if isfile(join("slave/images", f))]
|
||||||
|
self.lastvideo = -1
|
||||||
|
self.lastimage = -1
|
||||||
|
print(self.videos)
|
||||||
|
print(self.videos[randint(0, len(self.videos)-1)])
|
||||||
|
|
||||||
|
def idle(self):
|
||||||
|
last = -1
|
||||||
|
|
||||||
|
while True:
|
||||||
|
# if i == last:
|
||||||
|
# continue
|
||||||
|
if randint(0,5) == 0:
|
||||||
|
self.showimage()
|
||||||
|
else:
|
||||||
|
self.playvideo()
|
||||||
|
|
||||||
|
def showimage(self):
|
||||||
|
totalimages = len(self.images)-1
|
||||||
|
i = randint(0, totalimages)
|
||||||
|
if i == self.lastimage:
|
||||||
|
i += 1
|
||||||
|
if i > totalimages:
|
||||||
|
i = 0
|
||||||
|
self.lastimage = i
|
||||||
|
self.image.show(self.images[i])
|
||||||
|
cv2.waitKey(10000)
|
||||||
|
|
||||||
|
def playvideo(self):
|
||||||
|
totalvideos = len(self.videos)-1
|
||||||
|
i = randint(0, totalvideos)
|
||||||
|
if i == self.lastvideo:
|
||||||
|
i += 1
|
||||||
|
if i > totalvideos:
|
||||||
|
i = 0
|
||||||
|
self.lastvideo = i
|
||||||
|
video = self.videos[i]
|
||||||
|
print(video)
|
||||||
|
self.video.start(video)
|
||||||
|
self.image.blank()
|
||||||
|
cv2.waitKey(1)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
|
||||||
|
app = App(int(sys.argv[1]), int(sys.argv[2]))
|
||||||
|
app.idle()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
from random import randint
|
from random import randint
|
||||||
import cv2
|
import cv2
|
||||||
import numpy as np
|
import multiprocessing
|
||||||
import os
|
import time
|
||||||
|
import sys
|
||||||
|
|
||||||
class Video:
|
class Video:
|
||||||
def __init__(self, x, y):
|
def __init__(self, x, y):
|
||||||
self.x = x
|
self.x = x
|
||||||
self.y = y
|
self.y = y
|
||||||
|
|
||||||
def setVideo(self, path):
|
def start(self, path):
|
||||||
self.path = path
|
|
||||||
|
self.cap = cv2.VideoCapture(path)
|
||||||
def start(self):
|
|
||||||
self.run = True
|
|
||||||
self.cap = cv2.VideoCapture(self.path)
|
|
||||||
# Check if camera opened successfully
|
# Check if camera opened successfully
|
||||||
if (self.cap.isOpened()== False):
|
if (self.cap.isOpened()== False):
|
||||||
print("Error opening video file")
|
print("Error opening video file")
|
||||||
@@ -22,11 +20,20 @@ class Video:
|
|||||||
|
|
||||||
print("The total number of frames in this video is ", totalframecount)
|
print("The total number of frames in this video is ", totalframecount)
|
||||||
|
|
||||||
self.cap.set(cv2.CAP_PROP_POS_FRAMES, randint(0, totalframecount* 0.9))
|
i = randint(0, int(totalframecount * 0.9))
|
||||||
|
self.cap.set(cv2.CAP_PROP_POS_FRAMES, i)
|
||||||
|
|
||||||
# Read until video is completed
|
# Read until video is completed
|
||||||
while(self.cap.isOpened() and self.run):
|
fps = self.cap.get(cv2.CAP_PROP_FPS)
|
||||||
|
delay = 1/fps * 1000
|
||||||
|
print(fps, delay)
|
||||||
|
i = 0
|
||||||
|
playframes = randint(300, 500)
|
||||||
|
while(self.cap.isOpened() ):
|
||||||
|
i += 1
|
||||||
|
if i > playframes:
|
||||||
|
break
|
||||||
|
|
||||||
# Capture frame-by-frame
|
# Capture frame-by-frame
|
||||||
ret, frame = self.cap.read()
|
ret, frame = self.cap.read()
|
||||||
if ret == True:
|
if ret == True:
|
||||||
@@ -38,19 +45,21 @@ class Video:
|
|||||||
cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
|
cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
|
||||||
|
|
||||||
cv2.imshow("window", frame)
|
cv2.imshow("window", frame)
|
||||||
|
|
||||||
|
if cv2.waitKey(int(delay)) & 0xFF == ord('q'):
|
||||||
|
self.cap.release()
|
||||||
|
cv2.destroyAllWindows()
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
# Press Q on keyboard to exit
|
|
||||||
if cv2.waitKey(25) & 0xFF == ord('q'):
|
|
||||||
break
|
|
||||||
|
|
||||||
# Break the loop
|
# Break the loop
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
def stop(self):
|
|
||||||
self.run = False
|
|
||||||
self.cap.release()
|
self.cap.release()
|
||||||
|
|
||||||
# Closes all the frames
|
# Closes all the frames
|
||||||
cv2.destroyAllWindows()
|
#cv2.destroyAllWindows()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
video = Video(0, 0)
|
||||||
|
video.start("slave/videos/sample-mp4-file.mp4")
|
||||||
|
|
||||||
Reference in New Issue
Block a user