Added icon upload script, fixed ledmatrix for different layout
This commit is contained in:
18
config.json
18
config.json
@@ -1,8 +1,9 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"networks": [
|
"networks": [
|
||||||
{
|
{
|
||||||
"ssid":"yourWiFiSSID",
|
"ssid":"poes",
|
||||||
"password":"yourWiFiPassword"
|
"password":"Rijnstraat214"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ssid":"otherWiFiSSID",
|
"ssid":"otherWiFiSSID",
|
||||||
@@ -18,12 +19,13 @@
|
|||||||
"debug": false,
|
"debug": false,
|
||||||
"columns": 32,
|
"columns": 32,
|
||||||
"stride": 8,
|
"stride": 8,
|
||||||
"fps": 10
|
"fps": 10,
|
||||||
|
"rotation" : 0
|
||||||
},
|
},
|
||||||
"Boot": {
|
"Boot": {
|
||||||
"intensity": 0.03
|
"intensity": 0.03
|
||||||
},
|
},
|
||||||
"Animation": {
|
"disabledAnimation": {
|
||||||
"intensity": 0.05,
|
"intensity": 0.05,
|
||||||
"debug": false,
|
"debug": false,
|
||||||
"icons": [
|
"icons": [
|
||||||
@@ -36,17 +38,17 @@
|
|||||||
"icons/tv-movie.bin"
|
"icons/tv-movie.bin"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Clock": {
|
"disabledClock": {
|
||||||
"intensity": 0.05,
|
"intensity": 0.05,
|
||||||
"debug": true
|
"debug": true
|
||||||
},
|
},
|
||||||
"disabledDemo": {
|
"Demo": {
|
||||||
"intensity": 0.05
|
"intensity": 0.05
|
||||||
},
|
},
|
||||||
"Fire": {
|
"disabledFire": {
|
||||||
"intensity": 0.05
|
"intensity": 0.05
|
||||||
},
|
},
|
||||||
"Weather": {
|
"disabledWeather": {
|
||||||
"intensity": 0.05,
|
"intensity": 0.05,
|
||||||
"debug": true,
|
"debug": true,
|
||||||
"lat": 59.3293,
|
"lat": 59.3293,
|
||||||
|
|||||||
32
icondownload.sh
Executable file
32
icondownload.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
# Download icons (see https://github.com/noahwilliamsson/lamatrix/tree/master/icons)
|
||||||
|
curl -o icons/game-brick.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=1524
|
||||||
|
curl -o icons/game-invaders-1.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=3405
|
||||||
|
curl -o icons/game-invaders-2.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=3407
|
||||||
|
curl -o icons/game-tetris.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=4007
|
||||||
|
curl -o icons/game-nintendo.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=5038
|
||||||
|
curl -o icons/game-pacman-ghosts.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=20117
|
||||||
|
curl -o icons/game-pingpong.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=4075
|
||||||
|
curl -o icons/game-snake.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=16036
|
||||||
|
curl -o icons/matrix.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=653
|
||||||
|
curl -o icons/newyears.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=9356
|
||||||
|
curl -o icons/tv-movie.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=7862
|
||||||
|
# Convert JSON to a less verbose binary representation
|
||||||
|
scripts/convert-animation.py icons/*.json
|
||||||
|
rm icons/*.json
|
||||||
|
|
||||||
|
# Download weather icons (see https://github.com/noahwilliamsson/lamatrix/tree/master/weather)
|
||||||
|
curl -o weather/sunny.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=1338
|
||||||
|
curl -o weather/sunny-with-clouds.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=8756
|
||||||
|
curl -o weather/cloud-partly.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=2286
|
||||||
|
curl -o weather/cloudy.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=12019
|
||||||
|
curl -o weather/fog.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=17056
|
||||||
|
curl -o weather/moon-stars.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=16310
|
||||||
|
curl -o weather/rain-snow.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=160
|
||||||
|
curl -o weather/rain.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=72
|
||||||
|
curl -o weather/snow-house.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=7075
|
||||||
|
curl -o weather/snowy.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=2289
|
||||||
|
curl -o weather/thunderstorm.json https://developer.lametric.com/api/v1/dev/preloadicons?icon_id=11428
|
||||||
|
# Convert JSON to a less verbose binary representation
|
||||||
|
scripts/convert-animation.py weather/*.json
|
||||||
|
rm weather/*.json
|
||||||
|
|
||||||
@@ -77,13 +77,15 @@ class LedMatrix:
|
|||||||
# one step to the east, and then south to north, before the cycle
|
# one step to the east, and then south to north, before the cycle
|
||||||
# starts over.
|
# starts over.
|
||||||
stride = self.stride
|
stride = self.stride
|
||||||
phys_addr = ((x-1)%self.panelcolumn) + ((y-1)*self.panelcolumn) + (self.round_down((x-1)/self.panelcolumn) * self.panelcolumn * self.panelcolumn)
|
phys_addr = int(((x)%self.panelcolumn) + ((y)*self.panelcolumn) + (self.round_down((x)/self.panelcolumn) * self.panelcolumn * self.panelcolumn))
|
||||||
#MOD(x-1;panelCol) + ((y-1)*panelCol) + (FLOOR.MATH((x-1)/panelCol;1)*panelCol*panelRow)
|
#MOD(x-1;panelCol) + ((y-1)*panelCol) + (FLOOR.MATH((x-1)/panelCol;1)*panelCol*panelRow)
|
||||||
|
#print("xy_to_phys x=",x," y=",y," phys=",phys_addr)
|
||||||
|
|
||||||
# if x & 1:
|
# if x & 1:
|
||||||
# phys_addr += stride - 1 - y
|
# phys_addr += stride - 1 - y
|
||||||
# else:
|
# else:
|
||||||
# phys_addr += y
|
# phys_addr += y
|
||||||
# return phys_addr
|
return phys_addr
|
||||||
|
|
||||||
def get_pixel(self, x, y):
|
def get_pixel(self, x, y):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user