Task - import/implement our blocks and stop at black line
Implement a program for stopping at a black line with the blocks containing the implementation details for the InitArray, Calibration and Getting the calibrated result.
- #641
- 04 Oct 2017
Implement a program for stopping at a black line with the blocks containing the implementation details for the InitArray, Calibration and Getting the calibrated result.
Following the Advance Light/Color sensors calibration for a minimum value for a single sensor tutorial, in this one, we continue with finding the maximum value detected by a sensor and storing this value in an array.
A common question is how to display arrays on the LEGO Mindstorms EV3 brick screen. Displaying values from an array is not different from any other display operation. In this tutorial, we would look at displaying two specific values. The minimum and the maximum for a specific sensor from the Advance Calibration Course Section
In this tutorial, we show you how to display all the values from an EV3-G array on the EV3 brick display. We are using an array Read Operation along with a loop. We are also detecting the loop counter and using it as an index to an array. It's basically the only viable way to do it. The process is commonly referred to as - "Iteration over an array" (although we still do not have an iterator in the programming language, we promise that one day we would do the super advance videos on "iteration" using the LEGO MINDSTORMS robots")
One of the smartest things you could do in any software program is to extract logic in small reusable, simple, understandable units. In EV3-G these are called Blocks and we are going to extract the logic for finding a minimum and maximum for each of the sensors in a new block.
Following the Advanced Sensor Calibration course section, it is time to extract the logic for getting a calibrated value into a new block. This block will have an input and on this input, we give the port number. The block will return the calibrated value for this port number. We've built all the other blocks only because of this almost final video here.
This course is designed for students, mentors and teachers that are completely new to LEGO Mindstorms EV3 robots and would like to start using them to learn, in classes or at competitions. It is quite different from previously built resources at FLLCasts because it makes no assumption on any previous knowledge and tries to introduce everything step-by-step.
This is the simplest possible line following robot. It has just one sensor in the front between the two driving wheels and uses beams as pivots instead of a third wheel. Try it out. Follow the building instructions and start following lines in a number of minutes.
The CubeHunter uses the ultrasonic sensor to detect a ball or cube. Next, the robot catches it and reads the colour of the object using the EV3 colour sensor. The building instructions are suitable for classes with students and if you are working alone at home.
Building instructions for LEGO EV3 catching robot. It uses a medium motor to drive system of gears, which is used for catching objects. It, also, has an ultrasonic and colour sensors for detecting the objects.
Building instructions for constructing a simple LEGO Model that has red, green, blue and yellow beams. This makes it perfect for operating robots through color code.
Building instructions for the LEGO Mindstorms EV3 Catapult. The robot has a motor, a clutch to control it for manual shooting and a touch sensor for automatic loading. The bottom base is removed which means the Catapult could not be turned around. Nevertheless, the baseless robot is small enough to be built in class.
Program for displaying the value of the sensor on the screen
Program for calibrating including the DisplayLightSensor block
- source code of the block written in NXT-G. Download, directly import it and use it in your programs. Never ever miss a line.