TinyCircuits Forum

TinyCircuits Products => Thumby => Topic started by: UnRedKnown on November 23, 2023, 07:45:53 AM

Title: Blockly graphics not working
Post by: UnRedKnown on November 23, 2023, 07:45:53 AM
I wanted to make something not too complicated (blockly) but also relatively hard and currently missing from the arcade (as far as i'm aware), so i'm trying to make an all-in-one calculator, but basically all blocks from the graphics tab don't work, besides the print to display one. It's kinda hard to graph a quadratic funtion without drawing pixels. I tried with a much simpler program too, to see if it was maybe something else, but no.

TL;DR: Blockly graphics tab not working, not my fault
Title: Re: Blockly graphics not working
Post by: Jason on November 27, 2023, 09:59:08 AM
I wanted to make something not too complicated (blockly) but also relatively hard and currently missing from the arcade (as far as i'm aware), so i'm trying to make an all-in-one calculator, but basically all blocks from the graphics tab don't work, besides the print to display one. It's kinda hard to graph a quadratic funtion without drawing pixels. I tried with a much simpler program too, to see if it was maybe something else, but no.

TL;DR: Blockly graphics tab not working, not my fault

Could you share a screenshot of your blockly program? I can help you debug it that way.
Title: Re: Blockly graphics not working
Post by: UnRedKnown on December 01, 2023, 05:37:38 PM

Could you share a screenshot of your blockly program? I can help you debug it that way.

Figured it out, i didn't put the Draw to display block beforehand. Still, if i see Draw white fill, it should draw to display without anything else no?
Title: Re: Blockly graphics not working
Post by: Jason on December 01, 2023, 05:39:57 PM

Could you share a screenshot of your blockly program? I can help you debug it that way.

Figured it out, i didn't put the Draw to display block beforehand. Still, if i see draw to display it should draw to display without anything else no?

The draw block/code is required. Drawing everything out to the screen right away would take more time and impact performance. When you draw anything it is put in a buffer very quickly (compared to sending data to the screen) and then the entire buffer is sent in one transmission to the screen when you use the draw block.
Title: Re: Blockly graphics not working
Post by: UnRedKnown on December 01, 2023, 06:03:22 PM

Could you share a screenshot of your blockly program? I can help you debug it that way.

Figured it out, i didn't put the Draw to display block beforehand. Still, if i see draw to display it should draw to display without anything else no?

The draw block/code is required. Drawing everything out to the screen right away would take more time and impact performance. When you draw anything it is put in a buffer very quickly (compared to sending data to the screen) and then the entire buffer is sent in one transmission to the screen when you use the draw block.

Another issue would be that it only works in a loop? First does, second stays on print to display
Title: Re: Blockly graphics not working
Post by: Jason on December 04, 2023, 10:37:47 AM

Could you share a screenshot of your blockly program? I can help you debug it that way.

Figured it out, i didn't put the Draw to display block beforehand. Still, if i see draw to display it should draw to display without anything else no?

The draw block/code is required. Drawing everything out to the screen right away would take more time and impact performance. When you draw anything it is put in a buffer very quickly (compared to sending data to the screen) and then the entire buffer is sent in one transmission to the screen when you use the draw block.

Another issue would be that it only works in a loop? First does, second stays on print to display

The first image starts a while loop once A is pressed and then exits out of it when B is pressed.

The second image will only fill the screen with white while A is held down (not just quickly pressed).