Files
Matthew Grove ae8e42d68f Save RAM and improve volume changes
Save RAM by optimising imports and reducing class usage
Change volume by 8% each time, using saved volume value and only one query. Minimum volume is 1% and max is 100%. Queries are not run if decreasing volume from 1% or increasing from 100%
2024-05-16 22:55:51 +01:00

3 lines
200 B
Python

# method from Tony Goodhew 21st April 2022, for thepihut.com
def colour(R,G,B): # Convert RGB888 to RGB565
return (((G&0b00011100)<<3) +((B&0b11111000)>>3)<<8) + (R&0b11111000)+((G&0b11100000)>>5)