julien.launay
Posts: 51
Joined: Wed Mar 30, 2016 5:22 am

sensor list scratch

Sat Feb 04, 2017 8:48 am

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

mattmiller
Posts: 2064
Joined: Thu Feb 05, 2015 11:25 pm

Re: sensor list scratch

Sat Feb 04, 2017 12:34 pm

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

julien.launay
Posts: 51
Joined: Wed Mar 30, 2016 5:22 am

Re: sensor list scratch

Sun Feb 05, 2017 11:32 am

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

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: sensor list scratch

Tue Feb 07, 2017 12:16 pm

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

Return to “Astro Pi”