Python RGB Matrix games and animations https://www.xythobuz.de/ledmatrix_v2.html
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

camp_pico.py 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. #!/usr/bin/env python3
  2. # ----------------------------------------------------------------------------
  3. # "THE BEER-WARE LICENSE" (Revision 42):
  4. # <xythobuz@xythobuz.de> wrote this file. As long as you retain this notice
  5. # you can do whatever you want with this stuff. If we meet some day, and you
  6. # think this stuff is worth it, you can buy me a beer in return. Thomas Buck
  7. # ----------------------------------------------------------------------------
  8. camp_pink = (251, 72, 196)
  9. camp_green = (63, 255, 33)
  10. # QR code image for "Hello World"
  11. # size:21x21
  12. qr_data = [
  13. [
  14. (255, 255, 255),
  15. (255, 255, 255),
  16. (255, 255, 255),
  17. (255, 255, 255),
  18. (255, 255, 255),
  19. (255, 255, 255),
  20. (255, 255, 255),
  21. (0, 0, 0),
  22. (0, 0, 0),
  23. (255, 255, 255),
  24. (0, 0, 0),
  25. (0, 0, 0),
  26. (255, 255, 255),
  27. (0, 0, 0),
  28. (255, 255, 255),
  29. (255, 255, 255),
  30. (255, 255, 255),
  31. (255, 255, 255),
  32. (255, 255, 255),
  33. (255, 255, 255),
  34. (255, 255, 255),
  35. ],
  36. [
  37. (255, 255, 255),
  38. (0, 0, 0),
  39. (0, 0, 0),
  40. (0, 0, 0),
  41. (0, 0, 0),
  42. (0, 0, 0),
  43. (255, 255, 255),
  44. (0, 0, 0),
  45. (255, 255, 255),
  46. (0, 0, 0),
  47. (255, 255, 255),
  48. (255, 255, 255),
  49. (0, 0, 0),
  50. (0, 0, 0),
  51. (255, 255, 255),
  52. (0, 0, 0),
  53. (0, 0, 0),
  54. (0, 0, 0),
  55. (0, 0, 0),
  56. (0, 0, 0),
  57. (255, 255, 255),
  58. ],
  59. [
  60. (255, 255, 255),
  61. (0, 0, 0),
  62. (255, 255, 255),
  63. (255, 255, 255),
  64. (255, 255, 255),
  65. (0, 0, 0),
  66. (255, 255, 255),
  67. (0, 0, 0),
  68. (0, 0, 0),
  69. (255, 255, 255),
  70. (0, 0, 0),
  71. (0, 0, 0),
  72. (255, 255, 255),
  73. (0, 0, 0),
  74. (255, 255, 255),
  75. (0, 0, 0),
  76. (255, 255, 255),
  77. (255, 255, 255),
  78. (255, 255, 255),
  79. (0, 0, 0),
  80. (255, 255, 255),
  81. ],
  82. [
  83. (255, 255, 255),
  84. (0, 0, 0),
  85. (255, 255, 255),
  86. (255, 255, 255),
  87. (255, 255, 255),
  88. (0, 0, 0),
  89. (255, 255, 255),
  90. (0, 0, 0),
  91. (0, 0, 0),
  92. (255, 255, 255),
  93. (0, 0, 0),
  94. (0, 0, 0),
  95. (0, 0, 0),
  96. (0, 0, 0),
  97. (255, 255, 255),
  98. (0, 0, 0),
  99. (255, 255, 255),
  100. (255, 255, 255),
  101. (255, 255, 255),
  102. (0, 0, 0),
  103. (255, 255, 255),
  104. ],
  105. [
  106. (255, 255, 255),
  107. (0, 0, 0),
  108. (255, 255, 255),
  109. (255, 255, 255),
  110. (255, 255, 255),
  111. (0, 0, 0),
  112. (255, 255, 255),
  113. (0, 0, 0),
  114. (255, 255, 255),
  115. (255, 255, 255),
  116. (255, 255, 255),
  117. (0, 0, 0),
  118. (255, 255, 255),
  119. (0, 0, 0),
  120. (255, 255, 255),
  121. (0, 0, 0),
  122. (255, 255, 255),
  123. (255, 255, 255),
  124. (255, 255, 255),
  125. (0, 0, 0),
  126. (255, 255, 255),
  127. ],
  128. [
  129. (255, 255, 255),
  130. (0, 0, 0),
  131. (0, 0, 0),
  132. (0, 0, 0),
  133. (0, 0, 0),
  134. (0, 0, 0),
  135. (255, 255, 255),
  136. (0, 0, 0),
  137. (0, 0, 0),
  138. (0, 0, 0),
  139. (255, 255, 255),
  140. (0, 0, 0),
  141. (255, 255, 255),
  142. (0, 0, 0),
  143. (255, 255, 255),
  144. (0, 0, 0),
  145. (0, 0, 0),
  146. (0, 0, 0),
  147. (0, 0, 0),
  148. (0, 0, 0),
  149. (255, 255, 255),
  150. ],
  151. [
  152. (255, 255, 255),
  153. (255, 255, 255),
  154. (255, 255, 255),
  155. (255, 255, 255),
  156. (255, 255, 255),
  157. (255, 255, 255),
  158. (255, 255, 255),
  159. (0, 0, 0),
  160. (255, 255, 255),
  161. (0, 0, 0),
  162. (255, 255, 255),
  163. (0, 0, 0),
  164. (255, 255, 255),
  165. (0, 0, 0),
  166. (255, 255, 255),
  167. (255, 255, 255),
  168. (255, 255, 255),
  169. (255, 255, 255),
  170. (255, 255, 255),
  171. (255, 255, 255),
  172. (255, 255, 255),
  173. ],
  174. [
  175. (0, 0, 0),
  176. (0, 0, 0),
  177. (0, 0, 0),
  178. (0, 0, 0),
  179. (0, 0, 0),
  180. (0, 0, 0),
  181. (0, 0, 0),
  182. (0, 0, 0),
  183. (0, 0, 0),
  184. (255, 255, 255),
  185. (0, 0, 0),
  186. (255, 255, 255),
  187. (255, 255, 255),
  188. (0, 0, 0),
  189. (0, 0, 0),
  190. (0, 0, 0),
  191. (0, 0, 0),
  192. (0, 0, 0),
  193. (0, 0, 0),
  194. (0, 0, 0),
  195. (0, 0, 0),
  196. ],
  197. [
  198. (255, 255, 255),
  199. (0, 0, 0),
  200. (255, 255, 255),
  201. (0, 0, 0),
  202. (255, 255, 255),
  203. (0, 0, 0),
  204. (255, 255, 255),
  205. (0, 0, 0),
  206. (0, 0, 0),
  207. (255, 255, 255),
  208. (255, 255, 255),
  209. (255, 255, 255),
  210. (0, 0, 0),
  211. (0, 0, 0),
  212. (0, 0, 0),
  213. (0, 0, 0),
  214. (255, 255, 255),
  215. (0, 0, 0),
  216. (0, 0, 0),
  217. (255, 255, 255),
  218. (0, 0, 0),
  219. ],
  220. [
  221. (0, 0, 0),
  222. (255, 255, 255),
  223. (0, 0, 0),
  224. (255, 255, 255),
  225. (255, 255, 255),
  226. (0, 0, 0),
  227. (0, 0, 0),
  228. (255, 255, 255),
  229. (255, 255, 255),
  230. (0, 0, 0),
  231. (0, 0, 0),
  232. (0, 0, 0),
  233. (0, 0, 0),
  234. (0, 0, 0),
  235. (255, 255, 255),
  236. (255, 255, 255),
  237. (255, 255, 255),
  238. (0, 0, 0),
  239. (0, 0, 0),
  240. (255, 255, 255),
  241. (255, 255, 255),
  242. ],
  243. [
  244. (0, 0, 0),
  245. (255, 255, 255),
  246. (0, 0, 0),
  247. (0, 0, 0),
  248. (0, 0, 0),
  249. (0, 0, 0),
  250. (255, 255, 255),
  251. (255, 255, 255),
  252. (255, 255, 255),
  253. (0, 0, 0),
  254. (255, 255, 255),
  255. (0, 0, 0),
  256. (255, 255, 255),
  257. (255, 255, 255),
  258. (0, 0, 0),
  259. (255, 255, 255),
  260. (255, 255, 255),
  261. (255, 255, 255),
  262. (255, 255, 255),
  263. (255, 255, 255),
  264. (255, 255, 255),
  265. ],
  266. [
  267. (0, 0, 0),
  268. (255, 255, 255),
  269. (255, 255, 255),
  270. (0, 0, 0),
  271. (255, 255, 255),
  272. (255, 255, 255),
  273. (0, 0, 0),
  274. (255, 255, 255),
  275. (255, 255, 255),
  276. (255, 255, 255),
  277. (0, 0, 0),
  278. (0, 0, 0),
  279. (0, 0, 0),
  280. (0, 0, 0),
  281. (0, 0, 0),
  282. (0, 0, 0),
  283. (255, 255, 255),
  284. (0, 0, 0),
  285. (0, 0, 0),
  286. (255, 255, 255),
  287. (0, 0, 0),
  288. ],
  289. [
  290. (0, 0, 0),
  291. (255, 255, 255),
  292. (0, 0, 0),
  293. (255, 255, 255),
  294. (255, 255, 255),
  295. (0, 0, 0),
  296. (255, 255, 255),
  297. (0, 0, 0),
  298. (255, 255, 255),
  299. (255, 255, 255),
  300. (255, 255, 255),
  301. (0, 0, 0),
  302. (255, 255, 255),
  303. (255, 255, 255),
  304. (0, 0, 0),
  305. (255, 255, 255),
  306. (255, 255, 255),
  307. (0, 0, 0),
  308. (0, 0, 0),
  309. (0, 0, 0),
  310. (0, 0, 0),
  311. ],
  312. [
  313. (0, 0, 0),
  314. (0, 0, 0),
  315. (0, 0, 0),
  316. (0, 0, 0),
  317. (0, 0, 0),
  318. (0, 0, 0),
  319. (0, 0, 0),
  320. (0, 0, 0),
  321. (255, 255, 255),
  322. (0, 0, 0),
  323. (255, 255, 255),
  324. (255, 255, 255),
  325. (0, 0, 0),
  326. (255, 255, 255),
  327. (0, 0, 0),
  328. (0, 0, 0),
  329. (0, 0, 0),
  330. (0, 0, 0),
  331. (255, 255, 255),
  332. (255, 255, 255),
  333. (0, 0, 0),
  334. ],
  335. [
  336. (255, 255, 255),
  337. (255, 255, 255),
  338. (255, 255, 255),
  339. (255, 255, 255),
  340. (255, 255, 255),
  341. (255, 255, 255),
  342. (255, 255, 255),
  343. (0, 0, 0),
  344. (0, 0, 0),
  345. (255, 255, 255),
  346. (255, 255, 255),
  347. (255, 255, 255),
  348. (0, 0, 0),
  349. (0, 0, 0),
  350. (0, 0, 0),
  351. (255, 255, 255),
  352. (255, 255, 255),
  353. (0, 0, 0),
  354. (255, 255, 255),
  355. (255, 255, 255),
  356. (255, 255, 255),
  357. ],
  358. [
  359. (255, 255, 255),
  360. (0, 0, 0),
  361. (0, 0, 0),
  362. (0, 0, 0),
  363. (0, 0, 0),
  364. (0, 0, 0),
  365. (255, 255, 255),
  366. (0, 0, 0),
  367. (0, 0, 0),
  368. (0, 0, 0),
  369. (0, 0, 0),
  370. (255, 255, 255),
  371. (255, 255, 255),
  372. (0, 0, 0),
  373. (0, 0, 0),
  374. (255, 255, 255),
  375. (0, 0, 0),
  376. (0, 0, 0),
  377. (0, 0, 0),
  378. (0, 0, 0),
  379. (255, 255, 255),
  380. ],
  381. [
  382. (255, 255, 255),
  383. (0, 0, 0),
  384. (255, 255, 255),
  385. (255, 255, 255),
  386. (255, 255, 255),
  387. (0, 0, 0),
  388. (255, 255, 255),
  389. (0, 0, 0),
  390. (255, 255, 255),
  391. (255, 255, 255),
  392. (255, 255, 255),
  393. (255, 255, 255),
  394. (0, 0, 0),
  395. (0, 0, 0),
  396. (0, 0, 0),
  397. (0, 0, 0),
  398. (255, 255, 255),
  399. (0, 0, 0),
  400. (0, 0, 0),
  401. (0, 0, 0),
  402. (0, 0, 0),
  403. ],
  404. [
  405. (255, 255, 255),
  406. (0, 0, 0),
  407. (255, 255, 255),
  408. (255, 255, 255),
  409. (255, 255, 255),
  410. (0, 0, 0),
  411. (255, 255, 255),
  412. (0, 0, 0),
  413. (0, 0, 0),
  414. (255, 255, 255),
  415. (255, 255, 255),
  416. (255, 255, 255),
  417. (0, 0, 0),
  418. (0, 0, 0),
  419. (255, 255, 255),
  420. (255, 255, 255),
  421. (255, 255, 255),
  422. (0, 0, 0),
  423. (255, 255, 255),
  424. (255, 255, 255),
  425. (0, 0, 0),
  426. ],
  427. [
  428. (255, 255, 255),
  429. (0, 0, 0),
  430. (255, 255, 255),
  431. (255, 255, 255),
  432. (255, 255, 255),
  433. (0, 0, 0),
  434. (255, 255, 255),
  435. (0, 0, 0),
  436. (255, 255, 255),
  437. (0, 0, 0),
  438. (255, 255, 255),
  439. (0, 0, 0),
  440. (255, 255, 255),
  441. (0, 0, 0),
  442. (255, 255, 255),
  443. (0, 0, 0),
  444. (255, 255, 255),
  445. (0, 0, 0),
  446. (255, 255, 255),
  447. (0, 0, 0),
  448. (255, 255, 255),
  449. ],
  450. [
  451. (255, 255, 255),
  452. (0, 0, 0),
  453. (0, 0, 0),
  454. (0, 0, 0),
  455. (0, 0, 0),
  456. (0, 0, 0),
  457. (255, 255, 255),
  458. (0, 0, 0),
  459. (0, 0, 0),
  460. (0, 0, 0),
  461. (255, 255, 255),
  462. (255, 255, 255),
  463. (0, 0, 0),
  464. (0, 0, 0),
  465. (0, 0, 0),
  466. (0, 0, 0),
  467. (255, 255, 255),
  468. (0, 0, 0),
  469. (0, 0, 0),
  470. (255, 255, 255),
  471. (0, 0, 0),
  472. ],
  473. [
  474. (255, 255, 255),
  475. (255, 255, 255),
  476. (255, 255, 255),
  477. (255, 255, 255),
  478. (255, 255, 255),
  479. (255, 255, 255),
  480. (255, 255, 255),
  481. (0, 0, 0),
  482. (255, 255, 255),
  483. (255, 255, 255),
  484. (0, 0, 0),
  485. (255, 255, 255),
  486. (255, 255, 255),
  487. (0, 0, 0),
  488. (0, 0, 0),
  489. (255, 255, 255),
  490. (0, 0, 0),
  491. (0, 0, 0),
  492. (0, 0, 0),
  493. (255, 255, 255),
  494. (255, 255, 255),
  495. ],
  496. ]
  497. if True:#__name__ == "__main__":
  498. from solid import Solid
  499. from life import GameOfLife
  500. from net import CheckHTTP
  501. from qr import QRScreen
  502. from scroll import ScrollText
  503. from manager import Manager
  504. import util
  505. t = util.getTarget()
  506. # Main "Menu"
  507. m = Manager(t)
  508. m.add(ScrollText(t, "#CCCAMP23", "bitmap8", 1, 10, camp_green))
  509. m.add(Solid(t, 1.0))
  510. #m.add(QRScreen(t, qr_data, 30.0, "Drinks:", "bitmap8", (255, 255, 255), (0, 0, 0)))
  511. #m.add(Solid(t, 1.0))
  512. m.restart()
  513. t.loop(m.draw)