Help with project (Variables and data logging/light sensors)
-
- Posts: 5
- Joined: 08 Dec 2011, 13:47
Help with project (Variables and data logging/light sensors)
Could someone please have a look at this code and give me any pointers on how to make it work? Its supposed to roam around a white arena and it has a black outline if it hits the outline it is to reverse at a random degree and carry on moving, once it hits a shaded square it will make a noise and stop. For the data logging it is supposed to count up and display how many times it has detected that colour/dodged the edge of the arena. It is also supposed to detect nearby objects and reverse and change direction, for some reason it just isnt working and stops as soon as it hits the edge of the arena without carrying on.
The arena = white
edge of arena = black
shaded squares within arena = green
meant to come to a stand stil on a light blue square.
Any help would be greatly appreciated.
Thanks.
Johnsmithbear.
The arena = white
edge of arena = black
shaded squares within arena = green
meant to come to a stand stil on a light blue square.
Any help would be greatly appreciated.
Thanks.
Johnsmithbear.
-
- Posts: 5
- Joined: 08 Dec 2011, 13:47
Re: Help with project (Variables and data logging/light sensors)
where is my attachment??
Re: Help with project (Variables and data logging/light sensors)
Did you zip it?
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
-
- Posts: 5
- Joined: 08 Dec 2011, 13:47
Re: Help with project (Variables and data logging/light sensors)
Zipped it.
Does it work now?
Does it work now?
- Attachments
-
- arena.zip
- Zipped?
- (590.14 KiB) Downloaded 419 times
-
- Posts: 5
- Joined: 08 Dec 2011, 13:47
Re: Help with project (Variables and data logging/light sensors)
Any help is urgently required if possible?
-
- Posts: 290
- Joined: 03 Oct 2011, 00:06
- Location: Gallifrey
- Contact:
Re: Help with project (Variables and data logging/light sensors)
Have you tested to see if all the different colors have enough contrast? Or are you using a color sensor?
A.K.A. NeXT-Generation.
"A kingdom of heaven for RobotC now has recursion!"
"A kingdom of heaven for RobotC now has recursion!"
-
- Posts: 5
- Joined: 08 Dec 2011, 13:47
Re: Help with project (Variables and data logging/light sensors)
yes we have, I think the problem lies in the fact that once it has detected the first thing it detects the robot is just stopping instead of carrying on moving if you get what I mean?
-
- Posts: 290
- Joined: 03 Oct 2011, 00:06
- Location: Gallifrey
- Contact:
Re: Help with project (Variables and data logging/light sensors)
I've looked at your code, and made what improvements I can. I'm not sure what is causing your problem, but I think you should try this.
- Attachments
-
- arena.zip
- Helped?
- (586.73 KiB) Downloaded 490 times
A.K.A. NeXT-Generation.
"A kingdom of heaven for RobotC now has recursion!"
"A kingdom of heaven for RobotC now has recursion!"
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: Help with project (Variables and data logging/light sensors)
inxt-generation: when offering alternate code, please try to explain any changes you made. I didn't notice anything different in your code.
johnsmithbear: I assume this is not what you intended: When the light reading is between 37-42, the robot will backup one rotation, turn for ZERO degrees, then continue forward. (it's actually set to turn forever, but not wait any time)
It doesn't exactly sound like that's your only problem. I'd suggest you display your counter values INSIDE the main loop, so you can see if they're changing.
Steve
johnsmithbear: I assume this is not what you intended: When the light reading is between 37-42, the robot will backup one rotation, turn for ZERO degrees, then continue forward. (it's actually set to turn forever, but not wait any time)
It doesn't exactly sound like that's your only problem. I'd suggest you display your counter values INSIDE the main loop, so you can see if they're changing.
Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
-
- Posts: 1
- Joined: 13 Dec 2011, 15:03
Re: Help with project (Variables and data logging/light sensors)
hi there im a friend of johnsmithbear, the aim is to get the robot using the light sensors on the code to negotiate between white (continues moving) light grey (counts 1) dark grey (stops and finishes) and black (stops reverses and rotates)
iv looked at the code that has been changed and i cannot see the difference have you uploaded the correct one? try changing the file name, your help is much appreciated thankyou.
Not only should the robot use the light sensor as above, it should also use the ultrasonic sensor to navigate objects. If it helps i can send you the brief for the task. The deadline for this is wednesday evening, and were currently stumped by what is happening.
Once again thankyou for your help its much appreciated
iv looked at the code that has been changed and i cannot see the difference have you uploaded the correct one? try changing the file name, your help is much appreciated thankyou.
Not only should the robot use the light sensor as above, it should also use the ultrasonic sensor to navigate objects. If it helps i can send you the brief for the task. The deadline for this is wednesday evening, and were currently stumped by what is happening.
Once again thankyou for your help its much appreciated
Who is online
Users browsing this forum: No registered users and 0 guests