I realize I must have to use timers but when I try to use them instead of the array saving a value every second every element in the array changes. I've spent hours trying to get my head round this but cant figure it out.

Any pointers would be much appreciated! Thanks.

Wed Apr 09, 2014 11:48 am

BurningLights

Professor

Joined: Sat Aug 31, 2013 9:15 amPosts: 256

Re: Arrays and sensors.

It would be helpful if you posted your entire code, especially the stuff that keeps the robot in the arena. It's kind of hard to tell you how to integrate the two pieces together without seeing that. Although, one way you could do it is to create a separate task for storing the light sensor values in an array, assuming you don't use the values in the array in any other part of your code.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum