Development

Sensors / Radiation Board:

» RB 03: Using led array

This example shows how to manage radiation board led array.

Required Materials

1 x Waspmote
1 x Battery
1 x Coin battery
1 x Radiation board
1 x Geiger tube

Notes

Geiger tube should not be exposed to sunlight because the CPM may not be as accurate as indoors. We advise to use an opaque enclosure when working outdoors to cover this sensor.
Never touch Geiger-Müller tube ends directly with hands or using any metallic object under any circumstance. Tube ends works with high voltages (up to 500V) which can produce spikes if they are touched. Internal circuits of radiation board and even the user could be seriously affected.
The battery must be connected in ANY example.

Code

/*  
 *  -------------------------- RB.3 - Using led array ------------------- 
 *  
 *  Explanation: This example shows how to manage radiation board led array.
 *    
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L. 
 *  http://www.libelium.com 
 *  
 *  This program is free software: you can redistribute it and/or modify 
 *  it under the terms of the GNU General Public License as published by 
 *  the Free Software Foundation, either version 3 of the License, or 
 *  (at your option) any later version. 
 *  
 *  This program is distributed in the hope that it will be useful, 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 *  GNU General Public License for more details. 
 *  
 *  You should have received a copy of the GNU General Public License 
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 *  
 *  Version:           0.1 
 *  Design:            David Gascón 
 *  Implementation:    Javier Siscart 
 */

#include "WaspSensorRadiation.h"

void setup()
{

  // Starting USB
  USB.ON();
  USB.println(F("Starting Waspmote..."));

  // Starting Radiation Board
  RadiationBoard.ON();

}

void loop()
{

  // This example uses default values defined in WaspSensorRadiation.h
  // The user can define its own thresholds and use led array freely
  
  // 1. Set all leds OFF.
  RadiationBoard.ledBar(0);
  USB.println(F("Now leds are OFF"));
  delay(2000);
  
  // 2. Seting level one
  RadiationBoard.ledBar(TH1);
  delay(500);
  
  // 3. Seting level two
  RadiationBoard.ledBar(TH2);
  delay(500);

  // 4. Seting level three
  RadiationBoard.ledBar(TH3);
  delay(500);

  // 5. Seting level four
  RadiationBoard.ledBar(TH4);
  
  // 6. Seting level five
  RadiationBoard.ledBar(TH5);
  USB.println(F("Now all leds are ON"));
  delay(2000);

}

Output

Starting Waspmote...
Now leds are OFF
Now all leds are ON

Quick Publish: