casioplot is a preinstalled micropython module on casio graphing calculators that support MicroPython. Such as the Casio fx-CG50
- x : integer, x coordinate on screen
- y : integer, y coordinate on screen
- Returns a tuple with the colour of the specified pixel, if value is off screen it returns None
Gets a pixel on the screen using (x, y) coordinates
import casioplot
#Valid input
pixel_colour = casioplot.get_pixel(5, 10)
print(pixel_colour)
(255, 255, 255)
#Invalid input
pixel_colour = casioplot.get_pixel(2000, 2000)
print(pixel_colour)
None
- x : integer, x coordinate on screen
- y : integer, y coordinate on screen
- rgb : tuple, colour of pixel in RGB format
- None
Set a pixel in VRAM using (x, y) coordinates and RGB
import casioplot
casioplot.set_pixel(20, 20, (255, 0, 0)) #sets the pixel at (20, 20) to red
casioplot.show_screen() #displays VRAM
- x : integer, x coordinate on screen (starting from upper left corner)
- y : integer, y coordinate on screen (starting from upper left corner)
- string : string, string to be displayed on the scrren
- rgb : tuple, colour of pixel in RGB format
- text_size : string, size of text, can be small, medium or large
- None
Draws a string into VRAM
import casioplot
casioplot.draw_string(20, 20, "test_string", (255, 0, 0), "large") #draws a large red string starting at (20,20)
casioplot.show_screen() #displays VRAM
- None
- None
Displays the VRAM
import casioplot
casioplot.set_pixel(20, 20, (255, 0, 0)) #sets the pixel at (20, 20) to red
casioplot.show_screen() #displays VRAM
- None
- None
Clears the VRAM
import casioplot
casioplot.set_pixel(20, 20, (255, 0, 0)) #sets the pixel at (20, 20) to red
casioplot.show_screen() #displays VRAM
casioplot.clear_screen() #clears VRAM
casioplot.set_pixel(20, 30, (0, 255, 0)) #sets the pixel at (20,30) to green