How to use grow - 10 common examples

To help you get started, we’ve selected a few grow examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CommonGarden / Grow-IoT / tests / test-device.js View on Github external
function testDevice (u, t) {
  var testDevice = new Thing({
    // PUT YOUR UUID AND TOKEN HERE OR SUPPLY THEM AS ARGUMENTS
    uuid: u,
    token: t,
    component: 'TestDevice',

    properties: {
      state: 'off',
      interval: 3000
    },

    start: function () {
      setInterval(()=> {
        testDevice.call('temp_data');
      }, this.get('interval'));
    },
github CommonGarden / Grow-IoT / packages / Grow.js / examples / test-device.js View on Github external
let Thing = require('Grow.js');

let testDevice = new Thing({
  uuid: 'test',
  token: 'test',

  component: 'Thermostat',

  // Properties can be updated by the API
  properties: {
    state: 'off',
    growfile: {
      temperature: {
        min: 1,
        ideal: 4,
        max: 9,
        pid: {
          k_p: 300,
          k_i: 0,
github CommonGarden / Grow-IoT / tests / test-t3-component.js View on Github external
function testDevice (u, t) {
  var testDevice = new Thing({
    // PUT YOUR UUID AND TOKEN HERE OR SUPPLY THEM AS ARGUMENTS
    uuid: u,
    token: t,
    component: 'TentacleExample',

    properties: {
      interval: 3000,
      growfile: {
      	ph: {
      		min: 4.0,
      		max: 7.0,
      	},
      	ec: {
      		min: 700,
      		max: 1400,
      	},
github CommonGarden / Grow-IoT / tests / test-grow-mobile.js View on Github external
function createGrowHub(u, t) {
  const growHub = new Thing({
    uuid: u,
    token: t,
    component: 'GrowMobile',

    // Properties can be updated by the API
    properties: {
      state: 'off',
      light_state: 'off',
      fan_state: 'off',
      pump_state: 'off',
      threshold: 300,
      interval: 3000,
      currently: null,
      lightconditions: null,
      growfile: {
        phases: {
github CommonGarden / Grow-IoT / packages / Grow.js / examples / arduino / misc / analog_water_temp.js View on Github external
board.on('ready', function start() {
    var data_interval,
        water_temp;

    // This requires OneWire support using the ConfigurableFirmata
    var thermometer = new five.Sensor('A0');

    thermometer.on('change', function(value) {
        console.log(value);
    // water_temp = this.celsius;
    });

    // Create a new grow instance and connect to https://grow.commongarden.org
    var grow = new Grow({
        uuid: 'meow',
        token: 'meow',

        component: 'Thermostat',

        // Properties can be updated by the API
        properties: {
            state: 'off',
            growfile: {
                temperature: {
                    min: 22,
                    ideal: 27,
                    max: 29,
                    pid: {
                        k_p: 300,
                        k_i: 0,
github CommonGarden / Grow-IoT / .examples / rasp-pi / webcam.js View on Github external
// See node-webcam docs for additional instructions.
// https://www.npmjs.com/package/node-webcam
const NodeWebcam = require( 'node-webcam' );
const Thing = require('Grow.js');
const fs = require('fs');
 
const opts = {
  width: 1280,
  height: 720,
  delay: 0,
  quality: 100,
  output: 'jpeg',
  verbose: true
}

const cam = new Thing({
  properties: {
    name: 'Camera',
    interval: 100000
  },

  picture: function () {
    NodeWebcam.capture( 'image', opts, ( err, data )=> {
      if ( !err ) console.log( 'Image created!' );
      fs.readFile('./' + data, (err, data) => {
        if (err) throw err; // Fail if the file can't be read.
        this.sendImage(data);
      });
    });
  },

  start: function () {
github CommonGarden / Grow-IoT / .examples / arduino / misc / water_temp.js View on Github external
board.on('ready', function start() {
  let data_interval,
    water_temp;

  // This requires OneWire support using the ConfigurableFirmata
  let thermometer = new five.Thermometer({
    controller: 'DS18B20',
    pin: 4
  });

  thermometer.on('change', function() {
    water_temp = this.celsius;
  });

  // Create a new grow instance and connect to https://grow.commongarden.org
  let grow = new Grow({
    uuid: 'meow',
    token: 'meow',

    component: 'Thermostat',

    // Properties can be updated by the API
    properties: {
      state: 'off',
      growfile: {
        temperature: {
          min: 22,
          ideal: 27,
          max: 29,
          pid: {
            k_p: 300,
            k_i: 0,
github CommonGarden / Grow-IoT / .examples / rasp-pi / drDose.js View on Github external
var pH_reading,
    eC_reading,
    data_interval,
    acidpump = new five.Pin('P1-11'),
    basepump = new five.Pin('P1-12'),
    nutrientpump = new five.Pin('P1-13');

  // Hack: Relays are inversed... make sure pumps are off.
  // Better hardware could take care of this... I'm not an electrical engineer.
  acidpump.high();
  basepump.high();
  nutrientpump.high();


  // Create a new grow instance and connect to https://grow.commongarden.org
  var grow = new Grow({
    uuid: '3080d548-a52e-4e08-9904-973c035533c9',
    token: 'rwJYs9ufZL2A53R8nQpnxwHjjY44eDXq',

    component: 'DrDose',

    // Properties can be updated by the API
    properties: {
      growfile: {
        ph: {
          min: 6.0,
          ideal: 6.15,
          max: 6.3,
          pid: {
            k_p: 0.25,
            k_i: 0.01,
            k_d: 0.01,
github CommonGarden / Grow-IoT / packages / Grow.js / examples / arduino / smart-light / smart-light.js View on Github external
board.on('ready', function start() {
    // Define variables
    var power = new five.Pin(11),
        LED = new five.Pin(13),
        lightSensor = new five.Sensor('A1');

    power.high();

    // Create a new thing.
    var light = new Thing({
        uuid: 'testmeow',
        token: 'testmeow',

        component: 'SmartLight',

        properties: {
            state: 'off',
            threshold: 300,
            interval: 1000,
            currently: null,
            lightconditions: null,
            cycles: {
                day: {
                    schedule: 'after 7:00am'
                },
                night: {
github CommonGarden / Grow-IoT / .examples / arduino / smart-light / smart-light.js View on Github external
board.on('ready', function start() {
  // Define variables
  var power = new five.Pin(11),
    LED = new five.Pin(13),
    lightSensor = new five.Sensor('A1');

  power.high();

  // Create a new thing.
  var light = new Thing({
    uuid: 'meow',
    token: 'meow',

    component: 'SmartLight',

    properties: {
      state: 'off',
      threshold: 300,
      interval: 1000,
      currently: null,
      lightconditions: null,
      cycles: {
        day: {
          schedule: 'after 7:00am'
        },
        night: {

grow

A declarative, file-based website generator for rapid website production.

MIT
Latest version published 9 years ago

Package Health Score

51 / 100
Full package analysis

Popular grow functions