| 295 | # display.fb.fill(display.fb_color(100,50,50)) |
| 296 | # display.show() |
| 297 | def enable_framebuffer(self,mono=False): |
| 298 | if mono == False: |
| 299 | self.fbformat = framebuf.RGB565 |
| 300 | self.rawbuffer = bytearray(self.width*self.height*2) |
| 301 | self.show = self.show_rgb |
| 302 | else: |
| 303 | self.fbformat = framebuf.MONO_HMSB |
| 304 | self.rawbuffer = bytearray((self.width*self.height+7)//8) |
| 305 | self.show = self.show_mono |
| 306 | |
| 307 | self.fb = framebuf.FrameBuffer(self.rawbuffer, |
| 308 | self.width,self.height,self.fbformat) |
| 309 | |
| 310 | # This function is used to conver an RGB value to the |
| 311 | # equivalent color for the framebuffer functions. |