GLOBAL SITE AUSTRALIAN SITE

EdBlock equivalent of barcode programs | Barcode reading | 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

Topic3
EdBlock equivalent of barcode programs
May 14, 2018
10:23 am
David
Member
Members
Forum Posts: 9
Member Since:
May 13, 2018
sp_UserOfflineSmall Offline

I posted this in the teachers lounge already but it probably belongs here instead.  I took a little time to work out what each of the 6 basic barcode programs do and then worked up both a pseudo code equivalent and an EdBlock approximation of the program.  If I find the time I will try to add EdWare and EdPy equivalents as well.

The hope was that this could be used as a bridge to help transition kids from barcodes to EdBlocks.  And if I get the EdWare and EdPy versions then it could be used to spiral back as they move up in language complexity.  It could also be used to show how each language is different, and how more complex languages require more code but also provide more control.  That actually lines up well with the real world, C# is simpler to code than C++ but has less power (and more protection).

Here is my first pass at a workable document

basic program guide

May 14, 2018
10:58 am
David
Member
Members
Forum Posts: 9
Member Since:
May 13, 2018
sp_UserOfflineSmall Offline

I’m also trying to work out how the barcodes work.  So far I have worked out the following:

 – the barcodes are made up of units of bars, where each bar can be black or white

 – barcodes are always 15 bars long with the first and last bar always being black

 – bars always alternate between black and white

 – you can have either 1 or 3 black bars in a row to form one logical bar

 – you can also have 1 or 3 white bars in a row to form one logical white bar

 – there must always be 5 black bars and 4 white bars in the barcode

 – That means that each bar can be made up of the following patterns

  1) three triple white bars, one single white bar, zero triple black bars, and five single black bars

  2) two triple white bars, two single white bars, one triple black bar, and 4 single black bars

  3) one triple white bar, three single white bars, two triple black bars, and three single black bars

  4) zero triple white bars, four single white bars, three triple black bars, and two single black bars

 – Right now only patterns 1 and 3 are used, but I don’t see any reason why you could not use the other patters.

May 15, 2018
2:32 am
David
Member
Members
Forum Posts: 9
Member Since:
May 13, 2018
sp_UserOfflineSmall Offline
Awaiting Moderation

May 15, 2018
2:41 am
David
Member
Members
Forum Posts: 9
Member Since:
May 13, 2018
sp_UserOfflineSmall Offline

An interesting exersize would be to ask the question what if we took away one black and white bar so there were only 4 black bars and 3 white bars.  Now how many combinations could we make.  What if we went the other way and added another pair of black and white bars so there are 6 black and 5 white, now how many pairs.  Finally what if we add a third bar type that is only 2 bars wide so there are now 3 possible white bars and three possible black bars.

In all the above cases, could we still insist on the bar code being a fixed width (with 5 black and 4 white we were insisting on the barcode being 15 physical bars long) or would making the changes break the bar code length.  What other combinations of bars could we use to guarantee that all patterns are always the same length.

Why do you think the bar code needs to be a fixed length, what use is that and what other ways could you get the same benefits.

May 15, 2018
10:17 am
Ben
Admin
Forum Posts: 179
Member Since:
August 24, 2015
sp_UserOfflineSmall Offline

Hi

Just to clear a few things up.

The barcodes work based on the distances between transitions between black and white (there is no real correlation to the number of black and white bars, you could invert the colours on each barcode and it would work the same)

Our barcodes are based on the Code 39 standard of creating barcodes: https://en.wikipedia.org/wiki/Code_39

Our barcodes technically store 9 bits of information but Edison can only reliably ready 7 bits of information, this is due to overlap and reverse reading issues.

7 bits of information give 128 possible barcodes, however these barcodes point to a location in Edisons memory.

The barcodes we have released point to the start of a pre-built program stored in memory, all other barcodes point to nothing.

For Edison V1 and Edison V2.0 it is not possible to create new barcodes that run custom programs

May 16, 2018
3:32 am
David
Member
Members
Forum Posts: 9
Member Since:
May 13, 2018
sp_UserOfflineSmall Offline

Interesting, I did not think to count the edges.  So there are 10 edges on the barcode giving you 9 measurable spans, hence the 9 bits of information.  Each span then can be ‘short’ or ‘long’, basically a binary pattern, giving us 2^9 combinations, with two bits somehow begin used to basically checksum the barcode. 

Well that makes my previous post look a bit silly laugh but still it is fun to try to figure out how things work!

So all the barcodes come out the same length because there must always be 3 long spans and 6 short spans.  That is probably partially why we can’t get all 512 combinations as well. 

I will need to read up on Code 39 a bit more when I have some free time!

  • 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