diff --git a/ledmatrix.py b/ledmatrix.py index 7692a16..bb8d755 100755 --- a/ledmatrix.py +++ b/ledmatrix.py @@ -55,7 +55,6 @@ class LedMatrix: return math.floor(n * multiplier) / multiplier - def xy_to_phys(self, x, y): """ Map x,y to physical LED address after accounting for display rotation @@ -74,12 +73,10 @@ class LedMatrix: x = y y = self.columns-1-tmp # The LEDs are laid out in a long string going from north to south, - # one step to the east, and then south to north, before the cycle + # one step to the east, and then south to north, before thxy e cycle # starts over. - stride = self.stride - 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) - #print("xy_to_phys x=",x," y=",y," phys=",phys_addr) + stride = self.strid + phys_addr = ((x)%self.panelcolumn) + ((y)*self.panelcolumn) + (self.round_down((x)/self.panelcolumn) * self.panelcolumn * self.panelcolumn) # if x & 1: # phys_addr += stride - 1 - y diff --git a/scripts/install_service.sh b/scripts/install_service.sh index 14aff28..faae21c 100755 --- a/scripts/install_service.sh +++ b/scripts/install_service.sh @@ -1,6 +1,6 @@ sudo cp lamatrix.service /lib/systemd/system sudo chmod 644 /lib/systemd/system/lamatrix.service -chmod +x /home/pi/hello_world.py +chmod +x ../main.py sudo systemctl daemon-reload sudo systemctl enable lamatrix.service sudo systemctl start lamatrix.service diff --git a/weatherscene.py b/weatherscene.py index 2c53bdd..7f2d0f0 100755 --- a/weatherscene.py +++ b/weatherscene.py @@ -29,8 +29,8 @@ class WeatherScene: self.icon = None self.debug = False self.intensity = 16 - self.lat = 59.3293 - self.lon = 18.0686 + self.lat = 51.666664 + self.lon = 5.3666652 self.api_url = 'https://opendata-download-metfcst.smhi.se' self.headers = { 'User-Agent':'weatherscene.py/1.0 (+https://github.com/noahwilliamsson/lamatrix)',