void gfx_Part1(void) { int i ; gfx_BGcolour(LIGHTGOLD) ; // to check CLS works with different bg color gfx_Cls() ; txt_BGcolour(LIGHTGOLD) ; // to ensure text goesn look odd txt_FGcolour(RED) ; putstr("gfx_A to gfx_L") ; printf("gfx_A to gfx_L\n") ; txt_FGcolour(LIME) ; // reset gfx_BevelShadow(1) ; // make it really dark gfx_BevelWidth(6) ; // make the button bigger by increasing the bevel size for (i = 1; i <= 10; i++) { gfx_Button(ON, 120,50, YELLOW, PURPLE, FONT3, 1, 1, "Test Button") ; sleep(100) ; gfx_Button(OFF, 120,50, YELLOW, PURPLE, FONT3, 1, 1, "Test Button") ; sleep(100) ; } gfx_BevelShadow(3) ; // back to default gfx_ChangeColour(LIME, WHITE) ; gfx_Circle(30,30,10,BLUE) ; gfx_CircleFilled(130,30,10,BLUE) ; gfx_Rectangle(60,60,100,100,RED) ; // draw a rectange to show where we are clipping gfx_ClipWindow(60,60,100,100) ; gfx_Clipping(ON) ; // turn clipping on but just use it for text gfx_MoveTo(40,80) ; putstr("1234567890asdfghjkl") ; // this is clipped gfx_Clipping(OFF) ; sleep(1000) ; printf("Display off\n") ; gfx_Contrast(0) ; sleep(1000) ; gfx_Contrast(1) ; printf("Display on\n") ; gfx_Ellipse(100,230, 50,30,RED) ; gfx_EllipseFilled(100,300, 50,30,AQUA) ; gfx_FrameDelay(6) ; printf("X Res= %d Y Res= %d\n",gfx_Get(X_MAX)+1, gfx_Get(Y_MAX)+1) ; printf("Pixel at 0,30 is %4.4x\n", gfx_GetPixel(0, 30)) ; gfx_Line(0,0,100,200,BLUE) ; gfx_LinePattern(0x00aa) ; gfx_Set(OBJECT_COLOUR, WHITE); gfx_LineTo(239,319) ; gfx_LinePattern(0) ; // reser gfx_BGcolour(BLACK) ; // reset txt_BGcolour(BLACK) ; // reset }
void picaso4d::begin() { DISPLAY_SERIAL.begin(BAUD_RATE); CORE_PIN9_CONFIG = PORT_PCR_MUX(6); //Taken from Audio library, needed to preserve AUDIO library capability on pin 9 CORE_PIN26_CONFIG = PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_PFE | PORT_PCR_MUX(3); CORE_PIN10_CONFIG = 0; CORE_PIN31_CONFIG = PORT_PCR_DSE | PORT_PCR_SRE | PORT_PCR_MUX(3); pinMode(DISPLAY_RESET_PIN, OUTPUT); digitalWrite(DISPLAY_RESET_PIN, HIGH); delay(100); digitalWrite(DISPLAY_RESET_PIN, LOW); delay(4000); gfx_ScreenMode(ORIENTATION); _displayWidth = gfx_Get(X_MAX); _displayHeight = gfx_Get(Y_MAX); }