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

Need help for moving data from 1 array to another

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



Joined: 23 Apr 2004
Posts: 227
Location: The Netherlands

View user's profile Send private message

Need help for moving data from 1 array to another
PostPosted: Thu Oct 05, 2006 12:04 pm     Reply with quote

I have the following problem:

I have an array display_buffer[50]
This array is used to display data to ten 5x7 matrix displays

Then i have a array input_buffer[100]
This array hold the data to be displayed

Now i will move the data from array input_buffer[0] to display_buffer[0]
50 bytes width

Then i will shift the data of array input_buffer[0] to display_buffer[1]
50 bytes width

I need this for a moving text board with ten max7221's
This will rotate the text from right to left one colums each time

Please help me with some sample code to do this
Can his be do with memcopy ?
rberek



Joined: 10 Jan 2005
Posts: 207
Location: Ottawa, Canada

View user's profile Send private message

PostPosted: Thu Oct 05, 2006 3:07 pm     Reply with quote

It would be useful for you to go back to your original threads on this topic, as many of the answers have been given to you already.

Specfically, if you look at this post:

http://www.ccsinfo.com/forum/viewtopic.php?t=27092&highlight=

you will see that circular buffers were recommended as a solution to what is the same problem you had 6 months ago. You don't physically move data, you move the pointers to the data.

Physically moving/shifting this amount of data is impractical. You can write data into your input array, then your display data can be obtained by pointing at the elements of the input data you are interested in displaying. After that data has been displayed, you may then overwrite it with new input data, or whatever. You just need a pointer to tell you where to place newly-arriving display data, and a pointer to tell you the next element or elements to display. These pointers move as data arrives or is displayed.

Before you ask, no , I have not used these display drivers to display and shift data, and no, I do not have sample code.
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