To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 63d03876 authored by remartin's avatar remartin
Browse files

Moved test compiler here. Added light sensor file.

parent 8a1314d2
//#define LEDPIN 11 //LED brightness (PWM) writing
#define LIGHTSENSORPIN A0 //Ambient light sensor reading
void setup() {
pinMode(LIGHTSENSORPIN, INPUT);
// pinMode(LEDPIN, OUTPUT);
Serial.begin(9600);
}
void loop() {
float reading = analogRead(LIGHTSENSORPIN); //Read light level
float square_ratio = reading / 1023.0; //Get percent of maximum value (1023)
square_ratio = pow(square_ratio, 2.0); //Square to make response more obvious
// analogWrite(LEDPIN, 255.0 * square_ratio); //Adjust LED brightness relatively
Serial.println(reading); //Display reading in serial monitor
delay(500);
delay(500);
}
// Copyright (C) 2018, ETH Zurich, D-ITET
// Martin Reinhard remartin @ee.ethz.ch
//
// This file is part of D-FaLL-System.
//
// D-FaLL-System 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.
//
// D-FaLL-System 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 D-FaLL-System. If not, see <http://www.gnu.org/licenses/>.
//
//
// ----------------------------------------------------------------------------------
// DDDD FFFFF L L SSSS Y Y SSSS TTTTT EEEEE M M
// D D F aaa L L S Y Y S T E MM MM
// D D --- FFFF a a L L --- SSS Y SSS T EEE M M M
// D D F a aa L L S Y S T E M M
// DDDD F aa a LLLL LLLL SSSS Y SSSS T EEEEE M M
//
//
// DESCRIPTION:
// Main function for testing the spotlightManager. Compile with customCooker.
//
// ----------------------------------------------------------------------------------
//#include<iostream>
#include<stdio.h>
#include "../../include/spotlightManager.h"
using namespace std;
int main(){
for(int i = 0; i<10; i++){
printf("Globifisch\n");
//cout << "GlobiSchnaegg";
}
spotlightManager slM;
// printf("Testing the message builder: ");
// printf((slM.buildMessage()).c_str());
// printf("\n");
//slM.setPTmanually(false);
slM.testPTupdater();
//slM.someDefaultSettings();
//slM.setPTmanually();
// need ros stuff before -> put into an init() method?
//slM.calibrateOrientation();
//slM.trivialDemo();
//slM.lineOnWall(true, 50);
return 0;
}
# Copyright (C) 2018, ETH Zurich, D-dddITET
# Martin Reinhard remartin @ee.ethz.ch
#
# This file is part of D-FaLL-System.
#
# D-FaLL-System 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.
#
# D-FaLL-System 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 D-FaLL-System. If not, see <http://www.gnu.org/licenses/>.
#
#
# ----------------------------------------------------------------------------------
# DDDD FFFFF L L SSSS Y Y SSSS TTTTT EEEEE M M
# D D F aaa L L S Y Y S T E MM MM
# D D --- FFFF a a L L --- SSS Y SSS T EEE M M M
# D D F a aa L L S Y S T E M M
# DDDD F aa a LLLL LLLL SSSS Y SSSS T EEEEE M M
#
#
# DESCRIPTION:
# Compiles the spotlight files only. Used for testing purposes.
# Run with 'bash customCooker.sh'.
#
# ----------------------------------------------------------------------------------
rm uwb_light
g++ ../../src/spotlightManager.cpp ../../src/SerialLight.cpp UWBL_testing_main.cpp -o uwb_light
./uwb_light
R
\ No newline at end of file
......@@ -32,7 +32,7 @@
// ----------------------------------------------------------------------------------
#include "SerialLight.h"
#include "../include/SerialLight.h"
SerialLight::SerialLight(){
......
rm uwb_light
g++ spotlightManager.cpp SerialLight.cpp UWBL_main.cpp -o uwb_light
./uwb_light -launchingViaRos true
......@@ -32,7 +32,7 @@
//
// ----------------------------------------------------------------------------------
#include "spotlightManager.h"
#include "../include/spotlightManager.h"
#define RAD2DEG 57.2957795131;
//#define PHI_DMX_PAN = //170/360, DMX steps per degree.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment