I want to make a block that will read a sensor but need to know how to get my Arduno code to return the value to the block
How to return value to block
OutoftheBOTS
#1
OutoftheBOTS
#3
I am making my own custom block using extension builder. I wanted to know how to get my ardunio code that I was wrapping up to return a value back the mbock. I have worked it out now thanks.
ralcoberro
#4
Hello @OutoftheBOTS,
You can do something like this
In setup window put all the stuff to set up your sensor
In the code window read the sensor without a “;”
For example, if you are checking your sensor connection pin with the name “pin” you can do:
(without the space betwen " * " and the world “pin”. I put the space because the editor)
setup:
mySensorConfigure(/* pin */);
code:
mySensorRead(/* pin */)
I hope it helps
Rodrigo