February 24, 2017
I am working on variables. As you mentioned in edBooks, there are 2 types of variables:
In edBooks examples, you use bytes for line tracking and words for light sensing. It is hard for me to understand the reason.
Why do you choose bytes when using line tracking sensor and words when using light sensor?
Is it something to do with the processing of the variables or its memory?
In addition, in edBook “10 lessons”, there is an example called Light alarm in which you use the variable Light level(type=words).
How does this work? How does the Edison know that when the light level is more than 100 then is “morning” and it should start playing beep? Why 100? How can we define the level? Have you use the “trial&error” method to define the level=100? Am I missing something?
Thank you very much,
August 24, 2015
When using the “Line Tracking” Edison is looking at the raw value of the light sensor under Edison and doing some calculations to determine if it is above a reflective or non-reflective surface. The “Line Tracker” block saves the value 0 if Edison is on a non-reflective surface or a 1 if Edison is on a reflective surface, so it only needs a small variable (byte)
The “Sense light” block allows you to save the raw value of one of Edison’s light sensors (including the line tracking sensor). These values can be 0- 4096 so they need a larger variable (word)
The light alarm was done using trial an error, When Edison is in a draw the light sensors are seeing very little light and returning a value under 80, we then added a small buffer to ensure it would work in most cases.
You could do it better by taking a reading as Edison starts, then use that as a reference to set the level
February 24, 2017
this was quite helpful!
However, I have one more question. How am I going to take these measurements? (by taking a reading as Edison starts) to set the level?
Thanks in advance,