npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tessel-summer-camp

v1.1.1

Published

This repository houses the libraries for the Seattle Academy Tessel summer camp. These libraries help the Tessel interface with servos and an accelerometer, and will be used to help the students program a robot.

Downloads

15

Readme

tessel-summer-camp

project

This repository houses the libraries for the Seattle Academy Tessel summer camp. These libraries were built to allow easy access to the Tessel’s servo shield, accelerometer shield, and GPIO pins. This will allow students to move around a small robot and allow it to interact with its environment.

software setup

The controller.js file contains all of the libraries needed. To import this library, simple install it on npm. This will put it in the node_moduels folder.

npm install 

To import the module into your program, just use require.

var Controller = require("tessel-summer-camp");

hardware setup

The button class in the tessel-summer-camp module allows the user to choose which port to use. However, every other class requires specific ports or pins to be used. Below is the tessel wiring layout:

alt tag

accelerometer

To use the controller’s accelerometer function, you need to initialize the object first. Run

Accelerometer = new Controller.Accelerometer(function()
{
});

This code will create the accelerometer object and call the anonymous function after sensor setup has begun. Once the sensor is initialized, it will gather data automatically as fast as it comes in. Just use the properties of the accelerometer prototype to get the sensor’s data. The following command gets a bool that represents whether or not the sensor is configured.

Accelerometer.Congifured

The following three commands get floats that represent the position of the accelerometer sensor.

Accelerometer.X
Accelerometer.Y
Accelerometer.Z

servo

To use the controller's servo function, you first need to initialize the servo object. LeftServoNumber is the position of the robot’s left servo on the servo shield, and RightServoNumber is the position of the robot’s right servo on the servo shield. The anonymous function is called when the servos have been setup and are ready to receive commands.

Servo = new Controller.Servo(LeftServoNumber, RightServoNumber, function()
{
});

The move function is used to move the servos once they are configured. The Servo argument indicated which servo to move, and must be either "left" or "right". The speed argument is the speed at which the servo should move, and must be between -100 and 100.

Servo.Move(Servo, Speed);

The configured property is a bool which will return true is the servos are setup.

Servo.Configured;

button

To use the button command, just initialize a new instance of the button object. The pin variable will be the GPIO pin, as a string. This could look like "G3" or "G6". The function variable will be the function that is called when the button is pressed.

new Controller.Button("G3", function() {
	console.log("Pressed!");
});

led matrix

For the LED Matrix to work properly, additional setup steps need to be taken. The code located in the directory node_modules/tessel-summer-camp/ArduinoLEDMatrix needs to be installed onto an ardiuno mini pro. Now you are ready to go!

None of this code worked and Kale got angry so he rewrote the function so strings are passed from the tessel over serial. The serial communication is pretty much useless and all screwed up so strings become numbers that are in no way related to the strings. Now there are two key works that will write things on the LCD. Writing on into the function writes a 1 on the LED matrix while writing off into the function writes a 2 on the LED matrix.

Controller.Display("on");

sound

To use the controller's Sound function, you first need to initialize the object. The Port variable should be set to 0, 1, or 2. These port values correspond with the G4, G5, and G6 GPIO pins. The Callback function will be called when the Sound function has been configured.

This also didn't work and sound capability has been moved to the arduino. Therefore communications are passed through serial communication (which is hardly usable in this instance). Use the function to toggle sound on and off.

Controller.Sound();