I'm trying to do a basic linefollow program which I can do without using variables easily enough but I thought I'd try and be a little more creative and put a calibration routine in, based loosely on the nxtprograms.com smoothfollow program calibration routine. As such I have four variables; White, Black, Grey, and Light. Light is a dynamic variable that is frequently rewritten from the light intensity value from a single light sensor. White and Black are measured by scanning to the left (and back again) whilst values are continually fed back so that the max. is set as White and the min. is set as Black. Grey is just (Black + White)/2. This, and the turn on green routine I've made, work but the line follow part based on the light sensors data and the variables don't work.
What I want to do is use these variables to control the duration of a motor block. I want it to move either left or right until it is either greater or less that Grey but nothing I've tried works. So far I've been doing things like this:
and
This does not work and I can't see why... how can I make this work?
TIA,
Simon
NXT-G:Controlling motor duration with light sensor variables
Re: NXT-G:Controlling motor duration with light sensor variables
closed... we made it work on our own.
Who is online
Users browsing this forum: No registered users and 4 guests