Development v12

Warning - Product Update

All the resources present on this section belong to Waspmote v12, Waspmote Plug & Sense! v12 and Meshlium v3.8.

If you have a Waspmote v15, Waspmote Plug & Sense! v15 or Meshlium v4.0 please go to the new Development Section.

Check what is your version and what are the differences between the old and the new one in this document.

» VC 03: Focus lens with calibration

This code helps you to focus the lens with a calibration program.

Required Materials

1 x Waspmote
1 x Battery
1 x Video Camera Sensor Board
1 x 3G module

Notes

- Waspmote must be powered with a battery
- Video Camera Sensor Board needs 3G Board to work
- This example is valid for Waspmote v12 and Waspmote v15

Code

/*  
 *  ------ VC_03 - Focusing the lens with calibration program -------- 
 *  
 *  Explanation: This code helps you to focus the lens with a calibration program.
 *  
 *  Copyright (C) 2016 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:           3.0
 *  Design:            David Gascón 
 *  Implementation:    Alejandro Gállego 
 */


#include "Wasp3G.h"

int answer;

void setup(){
    _3G.OFF();
    PWR.setSensorPower(SENS_3V3, SENS_ON);
    pinMode(ANA6,OUTPUT); // Configures pins for IR cut filter and LED light
    pinMode(DIGITAL1,OUTPUT);
    pinMode(DIGITAL3,OUTPUT);
    pinMode(DIGITAL8,OUTPUT);
    pinMode(DIGITAL6,OUTPUT);
    digitalWrite(ANA6,HIGH);
    digitalWrite(DIGITAL1,HIGH);
    digitalWrite(DIGITAL3,HIGH);
    digitalWrite(DIGITAL8,LOW);
    digitalWrite(DIGITAL6,LOW);
    pinMode(GPS_PW,OUTPUT);
    digitalWrite(GPS_PW,LOW);
}


void loop(){


    while(USB.available() == 0);

    do{
        answer = USB.read();
        switch (answer)
        {
        case 'a':
            _3G.powerIRLED(0);
            break;
        case 's':
            _3G.powerIRLED(1);
            break;
        case 'd':
            _3G.powerIRLED(2);
            break;
        case 'f':
            _3G.powerIRLED(3);
            break;
        case 'q':
            _3G.selectFilter(0);
            break;
        case 'w':
            _3G.selectFilter(1);
            break;
        }
        delay(100);
    }while(USB.available() > 0);



}



Output

H#

Quick Publish: