microsoft / pxt-brainpad

Microsoft MakeCode editor for the GHI Brainpad
https://makecode.brainpad.com/
Other
3 stars 11 forks source link

Add blocks to set a buffer variable to use in the SPI block #112

Open greg-norris opened 6 years ago

greg-norris commented 6 years ago

Hello sorry about the delay in getting you the code sample, we talked about Thursday. Where we need blocks added to set a buffer, that is required for the spi blocks to work. You'll notice the code that doesn't have a block in the sample below.

This is the program we are running: https://makecode.com/_6rCV0i1cbW8Y

We would like use the SPI bus and BrainPad pins to control the LED strips and make various projects. p1030789

pelikhan commented 6 years ago

Could you give more details about the missing functionality? Maybe in C++?

greg-norris commented 6 years ago

createbuffer blockmissing

The work around for the missing block, was to add this code on the JavaScript.

let dummy: Buffer = null let data: Buffer = null data = pins.createBuffer(4); dummy = pins.createBuffer(4);

The program: https://makecode.com/_6rCV0i1cbW8Y

pelikhan commented 6 years ago

Buffer is currently not supported in blocks. Do you expect the user to set the entire buffer or is this some internal function? If internal, simply author this in JavaScript