CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Nokia 3310 display : how to draw circle and line ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
spilz



Joined: 30 Jan 2012
Posts: 219

View user's profile Send private message

Nokia 3310 display : how to draw circle and line ?
PostPosted: Sun Aug 25, 2013 11:51 pm     Reply with quote

Hello everybody !!

I need your help for a project Smile

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 Smile

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: 19513

View user's profile Send private message

PostPosted: Mon Aug 26, 2013 12:12 am     Reply with quote

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: 219

View user's profile Send private message

PostPosted: Mon Aug 26, 2013 12:23 am     Reply with quote

Thanks for your reply, it s a good point to start Smile
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: 19513

View user's profile Send private message

PostPosted: Mon Aug 26, 2013 2:02 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group