mBlock doesn't call custom device blocks code in Live mode


#1

I’m developing a conston device based on Arduino. I put console logs in the “Live mode handler” onRun to see when the block is executed:
(args, app, device, block) => {
app.log(“block of ${block.opcode} is checked to trigger”);
}

But the block is never called when I press the “green flag” button
Need I put some code in the hat block ?
Screenshot%20from%202019-12-07%2015-37-48

Need I to code my own hat block for live mode?

Can you give me an example?

Best regards
Rodrigo


#2

Hi,when you in Live Mode, the block in Yellow is available:


#3

Yes, I put that block, but anyway the block aren’t called. Remember I using my own Device.
Check in the prior post that I wrote a log in the block’s onRun callback
(args, app, device, block) => {
app.log(block of ${block.opcode} is checked to trigger);
}

I did a new flow and now it is working, may be was a problem with que other flow… I don’t know.
Now I see de log:
mBlock log: block of rasti_block_1.BLOCK_1575492213651 is checked to trigger
mBlock log: Reading Byte from, device: SJ_XcW6_}dp+r`:^SoXH Data: {}

Thank you!
Rodrigo


#4

Hi Ralcoberro,
I am creating live mode for my own device too based on Arduino chip. But it not work. How to put code in event “When green flat is clicked”?