GLOBAL SITE AUSTRALIAN SITE

[SOLVED] VARIABLES | EdWare graphical programming | Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

This topic is locked
Topic3
[SOLVED] VARIABLES
March 25, 2017
12:03 am
demetraorth
Member
Members
Forum Posts: 7
Member Since:
February 24, 2017
sp_UserOfflineSmall Offline

Dear Ben,

I am working on variables. As you mentioned in edBooks, there are 2 types of variables:

Bytes: 0-255

Words: +/-32767

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,

Dem

March 28, 2017
12:49 pm
Ben
Admin
Forum Posts: 179
Member Since:
August 24, 2015
sp_UserOfflineSmall Offline

Hi Dem

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

March 30, 2017
12:11 am
demetraorth
Member
Members
Forum Posts: 7
Member Since:
February 24, 2017
sp_UserOfflineSmall Offline

Thanks Ben!

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,

Dem

March 30, 2017
11:42 am
Ben
Admin
Forum Posts: 179
Member Since:
August 24, 2015
sp_UserOfflineSmall Offline

Yep, thats the best way to do it.

Take a reading as the program starts and save it to a variable

This topic is locked
  • Keep up with Edison

    Sign up for our newsletter to get all things Edison delivered straight to your inbox.

  • This field is for validation purposes and should be left unchanged.

Heads up

The Australian Federal Parliament has passed a law that extends goods and services tax (GST) to low value imports of physical goods imported by consumers from 1 July 2018.

This means that all customers purchasing Edison robots and accessories with an Australian shipping address must now pay GST. The GST will be automatically added to your purchase and show as a line item on your invoice.

We've detected that you are in Australia, so we wanted to let you know that we have changed your settings to view our Australian site, which displays GST inclusive pricing.

You can change back to the GLOBAL SITE at any time using the link in the top left of the page.

OK got it!    Take me to the GLOBAL SITE instead

Country

Pin It on Pinterest

Share This