Page 1 of 1

sensor list scratch

Posted: Sat Feb 04, 2017 8:48 am
by julien.launay
Hello,

When I open a empty scratch file for create a new application, in don't have all the sensehat sensor in the list of sensor (sensor bloc command). I just have the standard Gpio sensor.
But when I open the sample sense-hat, then I have all the sensehat sensor.
So my question is, how to fix this problem and open a new file and access to all the sensehat sensor?
thanks to your help.
Best regards

Julien

Re: sensor list scratch

Posted: Sat Feb 04, 2017 12:34 pm
by mattmiller
If you look at the example - you'll see a couple of blocks under the on Green Flag HAT
You need to create a variable called AddOn and then add these blocks to any Scratch project that wants to use the SenseHAT

Re: sensor list scratch

Posted: Sun Feb 05, 2017 11:32 am
by julien.launay
Hello,

I have done it, but, nothing appear!?
I have to open a sample to activate the list of the sensehat, I don't understand why? is there another solution?
thanks.

Julien

Re: sensor list scratch

Posted: Tue Feb 07, 2017 12:16 pm
by Davespice
Hi Julien

You need to do three things from a new project;
  • As mattmiller said you need to create a variable named AddOn and set its value to SenseHat
  • Create a broadcast block with the text gpioserveron
  • Execute both blocks by either docking them together and double clicking them, or using a when Green Flag clicked block
You should then see the sensors come available.
I hope that helps.

Dave