Bug in Blocos

10 views
Skip to first unread message

doctek

unread,
Jan 12, 2010, 9:30:50 PM1/12/10
to br-gogo
Has anyone else had problems with the "Reset timer" block on the Time
tab? When I enter the following program (aside - is there a way to
post images to this group?):

Start
Loop - Reset timer
Motor A On
Wait Until - Timer > 255
Reverse A

This is the code that is downloaded:
[0, 3, 15, 128, None, 46, 49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 4,
15, 7] Not what I would expect!

The code actually downloaded is even stranger. The memory dump looks
like this:
00 03 0F 80 83 00 14 85 00 03 80 00 00 83 0F F0 85 00 02 00 16 87 80
00 00 00

Have others seen this same problem?

-jim

Lucas Tanure

unread,
Jan 14, 2010, 12:39:57 PM1/14/10
to br-...@googlegroups.com
Jim,

Can you send to me a PrintScreen of the software with your code? How do you read the code at the microcontroler? You use with Gogo Board Serial ? Or you use Babuino? Why you don't expect the code that Blocos generates?

Regards!!


Lucas A. Tanure Alves
Equipe de Desenvolvimento Gogo Board Brasil
Skype : lucas.tanure
+55 (19) 88176559

Lucas Tanure

unread,
Jan 15, 2010, 6:14:19 AM1/15/10
to br-...@googlegroups.com


Hello Lucas -

I'm sending this directly to you since I'm not sure everyone on the Blocos Forum will want to see all the details and I'm not sure an attachment will go through properly. Please feel free to post this to the forum if you wish.

Following are the answers to your request for more information. I am using an Arduino with Babuino code.

Let me know if you need more information or details.

Thank you for your time and thanks for creating Blocos. It's a great environment!

-jim

Please see Reset_Pgm.png to see the program blocks.

This is the output from Blocos. I've deleted some of the Serial Port stuff at the beginning.

Testando porta 0
porta aberta
checando conexão na porta 0
checkConnection
()
>> testando conexao
....
....
135 0 55
()
Conectado na porta 0
compileAndSend
# pyCricketYacc -> analisarCodigo
pyCricketLex.build() terminou
yacc.yacc() terminou
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'to',1,0)'
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'start',1,3)'
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'loop',1,9)'
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'resett',1,17)'
# pyCricketLex -> t_MOTORATTENTION 'LexToken(MOTORATTENTION,'a,',1,25)'
# pyCricketYacc -> p_procedurecall ('resett')
jump pos: ( None )
**********NEED TO RECOMPILE************
# pyCricketYacc -> p_statement_value
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'on',1,28)'
# pyCricketYacc -> p_statement_motorAttention
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'waituntil',1,32)'
# pyCricketYacc -> p_statement_value
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'timer',1,44)'
# pyCricketYacc -> p_expression_value
# pyCricketLex -> t_NUMBERLITERAL 'LexToken(NUMBERLITERAL,'255',1,52)'
# pyCricketYacc -> p_expression_value
numero literal
# pyCricketYacc -> p_expression
# pyCricketLex -> t_MOTORATTENTION 'LexToken(MOTORATTENTION,'a,',1,58)'
# pyCricketYacc -> p_statement_waituntil
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'rd',1,61)'
# pyCricketYacc -> p_statement_motorAttention
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'stop',1,65)'
# pyCricketYacc -> p_statement_value
# pyCricketYacc -> p_statement_value
# pyCricketYacc -> p_statements_statement
# pyCricketYacc -> p_statements
# pyCricketYacc -> p_statements
# pyCricketYacc -> p_statements
# pyCricketYacc -> p_statements
# pyCricketYacc -> p_statements
# pyCricketYacc -> p_statements
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'end',1,72)'
# pyCricketYacc -> p_statement_loop
# pyCricketYacc -> p_statements_statement
# pyCricketYacc -> p_procedure
p[ 1 ] to
p[ 2 ] start
p[ 3 ] [3, 16, 128, None, 46, 49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15]

p[ 4 ] end
# pyCricketYacc -> p_procedures_procedure p[0]=p[1]='[0, 3, 16, 128, None, 46,
49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15, 7]'
RECOMPILE
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'to',1,0)'
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'start',1,3)'
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'loop',1,9)'
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'resett',1,17)'
# pyCricketLex -> t_MOTORATTENTION 'LexToken(MOTORATTENTION,'a,',1,25)'
# pyCricketYacc -> p_procedurecall ('resett')
jump pos: ( None )
**********NEED TO RECOMPILE************
# pyCricketYacc -> p_statement_value
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'on',1,28)'
# pyCricketYacc -> p_statement_motorAttention
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'waituntil',1,32)'
# pyCricketYacc -> p_statement_value
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'timer',1,44)'
# pyCricketYacc -> p_expression_value
# pyCricketLex -> t_NUMBERLITERAL 'LexToken(NUMBERLITERAL,'255',1,52)'
# pyCricketYacc -> p_expression_value
numero literal
# pyCricketYacc -> p_expression
# pyCricketLex -> t_MOTORATTENTION 'LexToken(MOTORATTENTION,'a,',1,58)'
# pyCricketYacc -> p_statement_waituntil
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'rd',1,61)'
# pyCricketYacc -> p_statement_motorAttention
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'stop',1,65)'
# pyCricketYacc -> p_statement_value
# pyCricketYacc -> p_statement_value
# pyCricketYacc -> p_statements_statement
# pyCricketYacc -> p_statements
# pyCricketYacc -> p_statements
# pyCricketYacc -> p_statements
# pyCricketYacc -> p_statements
# pyCricketYacc -> p_statements
# pyCricketYacc -> p_statements
# pyCricketLex -> t_PROCEDURENAME 'LexToken(PROCEDURENAME,'end',1,72)'
# pyCricketYacc -> p_statement_loop
# pyCricketYacc -> p_statements_statement
# pyCricketYacc -> p_procedure
p[ 1 ] to
p[ 2 ] start
p[ 3 ] [3, 16, 128, None, 46, 49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15]

p[ 4 ] end
# pyCricketYacc -> p_procedures_procedure p[0]=p[1]='[0, 3, 16, 128, None, 46,
49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15, 7]'
parse.parse() gerou resultado '[0, 3, 16, 128, None, 46, 49, 3, 5, 17, 1, 25
5, 29, 5, 14, 46, 54, 7, 4, 15, 7]'
code
[0, 3, 16, 128, None, 46, 49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15, 7]
enviar
enviarDados:
[0, 3, 16, 128, None, 46, 49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15, 7]
readByte
writeByte
codigoFinal
problema ao enviar os dados
enviarDados:
[128, 0, 0]
readByte
writeByte
codigoFinal
enviarDados:
[0, 21]
readByte
writeByte
codigoFinal
Code successfully sent!
fechando conexão existente

Look at the code generated (copied from above):
[0, 3, 16, 128, None, 46, 49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15, 7]
^^^^^^^^^^^^
I don't expect the code indicated for the Reset timer block. The rest is OK. When I dump the code written to my Babuino, here is what I get This code is read back in HEX using a Processing sketch.
00 03 10 80 83 00 15 85 00 03 80 00 00 83 0F F0 85 00 02 00 15 00 00

Here is the code that I would expect Blocos to generate for the Reset timer command (in HEX):

00 03 0F 12 2E 31 03 06 11 02 0F A0 1D 05 0E 2E 36 04 0F 07 80 00 00

When I load exactly this gode inot Babuino, it works as expected. This code is loaded and read back using a Processing sketch.

For comparison, if I take out the Reset timer block, this is the code Blocos generates. It loads and runs on Babuino just fine. When I read it back with the Processing sketch, it looks exactly like the Blocos code.

p[ 1 ] to
p[ 2 ] start
p[ 3 ] [3, 14, 46, 49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15]
p[ 4 ] end
# pyCricketYacc -> p_procedures_procedure p[0]=p[1]='[0, 3, 14, 46, 49, 3, 5, 1
7, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15, 7]'
parse.parse() gerou resultado '[0, 3, 14, 46, 49, 3, 5, 17, 1, 255, 29, 5, 1
4, 46, 54, 7, 4, 15, 7]'
code
[0, 3, 14, 46, 49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15, 7]
enviar
enviarDados:
[0, 3, 14, 46, 49, 3, 5, 17, 1, 255, 29, 5, 14, 46, 54, 7, 4, 15, 7]
readByte
writeByte
codigoFinal
enviarDados:
[128, 0, 0]
readByte
writeByte
codigoFinal
enviarDados:
[0, 19]
readByte
writeByte
codigoFinal
Code successfully sent!
fechando conexão existente


Reset_Pgm.png

Victor Matheus

unread,
Jan 24, 2010, 2:07:12 PM1/24/10
to br-...@googlegroups.com
Hi jim, I confirm your bug in Blocos, We have fixed it in last svn revision (r114).
your code should work now, at least it works on my machine :)

bye!

doctek

unread,
Jan 25, 2010, 1:46:54 PM1/25/10
to br-gogo
Thank you, Victor. The bug is fixed and the code works correctly.


On Jan 24, 11:07 am, Victor Matheus <victormath...@gmail.com> wrote:
> Hi jim, I confirm your bug in Blocos, We have fixed it in last svn revision
> (r114).
> your code should work now, at least it works on my machine :)
>
> bye!
>

Reply all
Reply to author
Forward
0 new messages