Hi, I ripped some glcd line draw code so I can modify it so if a line is off screen it re appears other side.
Well I have not sorted the code only ripped the basic draw line...which isn't much code.
If I check pset for edges/screen size/defined rectangle each pixel will make it slow.
need a new routine to plot to pre defined point then carry on to end from other edge/side
Any way this is simple draw code. does the classic image not fast as gcb line but near and should be easy to mod.
#chip mega328p,16#option explicit#include<glcd.h>#include<uno_mega328p.h >#define GLCD_TYPE GLCD_TYPE_ILI9341'PinmappingsforSPI-thisGLCDdriversupportsHardwareSPIandSoftwareSPI#define GLCD_DC DIGITAL_8 ' Data command line#define GLCD_CS DIGITAL_10 ' Chip select line#define GLCD_RESET DIGITAL_9 ' Reset line#define GLCD_DI DIGITAL_12 ' Data in | MISO - Not used therefore not really required#define GLCD_DO DIGITAL_11 ' Data out | MOSI#define GLCD_SCK DIGITAL_13 ' Clock Line#define ILI9341_HardwareSPIGLCDRotate(Landscape)GLCDCLSILI9341_Blackdimcntrasworddimdx,dy,sx,sy,er,e2asintegerdimx2,x1,y1,y2asworddimcolouraswordforcntr=1to319draw(cntr,1,320,240,ILI9341_White)nextend;--------------------------;thisthedrawlineroutinesubdraw(inx1,iny1,inx2,iny2,incolour)DX=ABS(X2-X1):SX=-1:IFX1<X2THENSX=1DY=ABS(Y2-Y1):SY=-1:IFY1<Y2THENSY=1ER=-DY:IFDX>DYTHENER=DX;rotateerrightsimpleER=ER/2pixel:psetX1,Y1,colourifx1=x2thenify1=y2thenreturnendifE2=ERIFE2>-DXTHENER=ER-DY:X1=X1+SXIFE2<DYTHENER=ER+DX:Y1=Y1+SYGOTOpixel
Hi, I ripped some glcd line draw code so I can modify it so if a line is off screen it re appears other side.
Well I have not sorted the code only ripped the basic draw line...which isn't much code.
If I check pset for edges/screen size/defined rectangle each pixel will make it slow.
need a new routine to plot to pre defined point then carry on to end from other edge/side
Any way this is simple draw code. does the classic image not fast as gcb line but near and should be easy to mod.