Created
December 6, 2023 23:14
-
-
Save irudnyts/244b93bc317f67cca71d69d96e5f365a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
from gpiozero import CPUTemperature | |
pygame.init() | |
clock = pygame.time.Clock() | |
screen = pygame.display.set_mode([400, 400]) | |
font = pygame.font.SysFont(None, 400) | |
cpu = CPUTemperature() | |
running = True | |
while running: | |
for event in pygame.event.get(): | |
if event.type == pygame.QUIT: | |
running = False | |
temp = str(round(cpu.temperature)) | |
screen.fill((0, 0, 0)) | |
screen.blit(font.render(temp, True, (255, 255, 255)), (0, 0)) | |
pygame.display.flip() | |
clock.tick(8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment