| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| spilz 
 
 
 Joined: 30 Jan 2012
 Posts: 220
 
 
 
			    
 
 | 
			
				| Nokia 3310 display : how to draw circle and line ? |  
				|  Posted: Sun Aug 25, 2013 11:51 pm |   |  
				| 
 |  
				| Hello everybody !! 
 I need your help for a project
   
 I m using a Nokia 3310 display with a pic18f2550, everything is doing well, I'm able to write ASCII characters with the code I found in this forum, thanks for that.
 
 But now I would like something more graphic for an analogic clock or an analogic compass, so something with circle and line
   
 I found a topic here where the screens look very nice, but I have absolutely no idea how to write a code to draw something like this :(
 
 Picture 1
 Picture 2
 
 Thanks for your help
 
 Spilz
 |  | 
	
		|  | 
	
		| Ttelmah 
 
 
 Joined: 11 Mar 2010
 Posts: 19966
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Mon Aug 26, 2013 12:12 am |   |  
				| 
 |  
				| Do a search, for "'Bresenham's algorithm". Programmer, who designed a very efficient algorithm for drawing lines. His name has also been applied to a similar algorithm for drawing conic sections (which includes the circle), so a Google search should find both.
 Key is that these involve operations that can efficiently be done even on simple processors.
 
 Best Wishes
 |  | 
	
		|  | 
	
		| spilz 
 
 
 Joined: 30 Jan 2012
 Posts: 220
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Mon Aug 26, 2013 12:23 am |   |  
				| 
 |  
				| Thanks for your reply, it s a good point to start   I will looking his algos
 
 But the problem with the Nokia 3310 display is that we can not change 1 pixel, we have to change 8pixels hitch time :(
 
 More difficult to draw a line in a circle :'(
 |  | 
	
		|  | 
	
		| Ttelmah 
 
 
 Joined: 11 Mar 2010
 Posts: 19966
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Mon Aug 26, 2013 2:02 am |   |  
				| 
 |  
				| You have to do what everyone else does, and generate your own algorithm to allow you to set one pixel.... You need a copy of the devices memory in RAM, then you perform the operations you want to this, and write the data to the display.
 Sorry, but that's the 'way it is'.
 
 Best Wishes
 |  | 
	
		|  | 
	
		|  |