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%
3 lines
200 B
Python
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) |