Make a directory inside your “tessel-code” folder called “ambient”, change directory into that folder, and initialize a tessel project:
mkdir ambient; cd ambient; t2 init
Plug the ambient module into Tessel port A with the hexagon/icon side down and the electrical components on the top, then plug Tessel into your computer via USB.
Install by typing
npm install ambient-attx4 into the command line.
Rename “index.js” to “ambient.js” and replace the file’s contents with the following:
Save the file.
In your command line,
t2 run ambient.js
Watch light and sound values appear in your terminal! Try clapping or shining a flashlight at it.
Bonus: Test out setting triggers with light and sound (hint: there is an example in the ambient module’s examples folder).
To see what else you can do with the ambient module, see the module docs here.
What else can you do with an ambient module? Try a community-created project.