diff --git a/csv/crypto.csv b/csv/crypto.csv index 2bdec31..1b63bce 100644 --- a/csv/crypto.csv +++ b/csv/crypto.csv @@ -1,3 +1,3 @@ symbol,name,base,current,24hr change -BTC,bitcoin,usd,36574,13.332115883704576 -ETH,ethereum,gbp,1838.29,6.811992501784067 +BTC,bitcoin,usd,36550,12.472300235837876 +ETH,ethereum,gbp,1838.88,5.808310892121005 diff --git a/csv/current_weather.json b/csv/current_weather.json index e42fbb9..ca20774 100644 --- a/csv/current_weather.json +++ b/csv/current_weather.json @@ -1 +1 @@ -{"main_weather": "Clouds", "description": "scattered clouds", "temp": 27.76, "min_temp": 26.64, "max_temp": 28.87, "feels_like": 33, "humidity": 90, "clouds": 26, "wind_speed": 0.45, "wind_direction": 42, "visibility": 10000, "uv": 0, "rain_chance": 0.41} \ No newline at end of file +{"main_weather": "Clouds", "description": "scattered clouds", "temp": 27.71, "min_temp": 26.64, "max_temp": 28.51, "feels_like": 32.84, "humidity": 90, "clouds": 26, "wind_speed": 2.68, "wind_direction": 90, "visibility": 10000, "uv": 0, "rain_chance": 0.41} \ No newline at end of file diff --git a/csv/daily_weather.json b/csv/daily_weather.json index 8f9a81e..d0f69dd 100644 --- a/csv/daily_weather.json +++ b/csv/daily_weather.json @@ -1 +1 @@ -[{"main_weather": "Rain", "description": "light rain", "min_temp": 27.38, "max_temp": 29.43}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.12, "max_temp": 29.24}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.26, "max_temp": 29.02}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.42, "max_temp": 28.3}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.69, "max_temp": 28.6}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.04, "max_temp": 29.2}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.96, "max_temp": 28.81}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.06, "max_temp": 30.03}] \ No newline at end of file +[{"main_weather": "Rain", "description": "light rain", "min_temp": 27.37, "max_temp": 29.43}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.12, "max_temp": 29.24}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.26, "max_temp": 29.02}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.42, "max_temp": 28.3}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.69, "max_temp": 28.6}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.04, "max_temp": 29.2}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.96, "max_temp": 28.81}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.06, "max_temp": 30.03}] \ No newline at end of file diff --git a/csv/last_update.csv b/csv/last_update.csv index 82df2e4..9972c3b 100644 --- a/csv/last_update.csv +++ b/csv/last_update.csv @@ -1 +1 @@ -09/06/2021 14:00:57 +09/06/2021 14:12:15 diff --git a/csv/tickers.csv b/csv/tickers.csv index 1d4c7d7..6fce526 100644 --- a/csv/tickers.csv +++ b/csv/tickers.csv @@ -1,4 +1,4 @@ name,current,opening -MSFT,254.87,253.81 -NFLX,490.31,494.5 -GOOG,2501.71,2499.5 +MSFT,254.81,253.81 +NFLX,490.17,494.5 +GOOG,2497.83,2499.5 diff --git a/final.ppm b/final.ppm index 4df63ca..a6aa544 100755 Binary files a/final.ppm and b/final.ppm differ diff --git a/final1.ppm b/final1.ppm index 4df63ca..24bd7ec 100755 Binary files a/final1.ppm and b/final1.ppm differ diff --git a/stockTicker.py b/stockTicker.py index 22f3176..13fe01c 100644 --- a/stockTicker.py +++ b/stockTicker.py @@ -93,9 +93,10 @@ class StockTicker(): # C functions can certainly be faster. img_width, img_height = image.size pixels = image.load() - for x in range(max(0,-offset_x), min(img_width, self.matrix.width - offset_x)): + for y in range(max(0, -offset_y), min(img_height, self.matrix.height - offset_y)): + for x in range(max(0,-offset_x), min(img_width, self.matrix.width - offset_x)): - for y in range(max(0, -offset_y), min(img_height, self.matrix.height - offset_y)): + (r, g, b) = pixels[x, y] if min_x <= x + offset_x <= max_x and min_y <= y + offset_y <= max_y: self.matrix.SetPixel(x + offset_x, y + offset_y, r*self.brightness, g*self.brightness, b*self.brightness) @@ -549,11 +550,11 @@ class StockTicker(): change = 1/current - 1/yesterday print(change) current = 1/current - current = '%.2f' % current + current = '%.3f' % current arrow, change = self.getArrow(change) - change = '%.5f' % change + change = '%.6f' % change midFrame = self.textToImage(currency + '(' + base + ')', current, change, arrow) #IMAGE THE TEXT @@ -1059,9 +1060,9 @@ if __name__ == '__main__': #stock_ticker.displayText() - stock_ticker.getFullStockImage(1) - stock_ticker.process_msg('f') - stock_ticker.displayStocks() + #stock_ticker.getFullStockImage(1) + #stock_ticker.process_msg('f') + #stock_ticker.displayStocks() #stock_ticker.displayStocks() #stock_ticker.delay = 0.001