Hallo
Ich bin Neuling, habe mich aber mit Arduino ein bischen beschäftigt ,
jetzt komm ich an meine grenzen. Ich möchte gerne einen Geigerzähler mit 2 Zähler Impulsen Bauen,
das mit einem Impuls funktioniert schon. Und mit logview wird das am Pc mit geschrieben.
jetzt möchte ich noch einen 2. Impuls zählen und mit logview plotten .
und auf einem Display anzeigen habe ein TC1604
vielleicht ist es nur eine kleinesache oder es geht vielleicht gar nicht so wie ich mir das vorstelle
Vielen dank
LG
Marc
Mein Arduino Mega 2530
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8,9,10,3,4,5,6);
// Threshold values for the led bar
//#define TH1 50
//#define TH2 150
//#define TH3 300
//#define TH4 600
//#define TH5 900
// Variables
//int ledArray [] = {13,};
int geiger_input = 1;
//int geiger_input = 2;
int count = 0;
int count2 = 0;
int countPerMinute = 0;
int countPerMinute2 = 0;
long timePrevious = 0;
long timePreviousMeassure = 0;
long time = 0;
int countPrevious = 0;
float radiationValue = 0.0;
void setup(){
pinMode(geiger_input, INPUT );
for (int i=0;i<5;i++){
//pinMode(ledArray*,OUTPUT);*
- }*
// pinMode(geiger_input2, INPUT);
// for (int i=0;i<5;i++){
// pinMode(ledArray*,OUTPUT);*
* //}*
* Serial.begin(19200);*
* //set up the LCD's number of columns and rows:*
* lcd.begin(16, 4);*
* lcd.clear();*
* lcd.clear(); *
* lcd.setCursor(0, 0);*
* lcd.print("CPM=");*
* lcd.setCursor(4,0);*
_ lcd.print(6count);_
_ lcd.setCursor(0,1);_
_ lcd.print(radiationValue);*_
* attachInterrupt(0,countPulse,FALLING);*
}
void loop(){
* if (millis()-timePreviousMeassure > 10000){*
_ countPerMinute = 6count;_
_ radiationValue = countPerMinute/360.0;_
_ timePreviousMeassure = millis();_
_ Serial.print("$1;1;0;");_
_ Serial.print((byte) countPerMinute,DEC);_
_ Serial.print(";");_
_ //Serial.print("uSv/h = ");_
_ Serial.print(radiationValue,4); _
_ Serial.print(";0");_
_ Serial.println(13,DEC);*_
* lcd.clear(); *
* lcd.setCursor(0,0);*
* lcd.print("CPM=");*
* lcd.setCursor(4,0);*
* lcd.print(countPerMinute);*
* lcd.setCursor(0,1);*
* lcd.print(radiationValue,4);*
* lcd.setCursor(6,1);*
* lcd.print(" uSv/h");*
* // Geigerzähler 2*
* //lcd.clear();*
* lcd.setCursor(-4,2);*
* lcd.print("CPM=");*
* lcd.setCursor(0,2);*
* lcd.print(countPerMinute2);*
* lcd.setCursor(-4,3);*
* lcd.print(radiationValue,4);*
* lcd.setCursor(2,3);*
* lcd.print(" uSv/h");*
* count = 0;*
* }*
}
void countPulse(){
* if(timePrevious != millis()){*
* count++;*
* time = millis()-timePrevious;*
* timePrevious = millis();*
* }*
}
//void ledVar(int value){
* //if (value > 0){*
* //for(int i=0;i<=value;i++){*
_ //digitalWrite(ledArray*,HIGH);
//}
//for(int i=5;i>value;i--){
//digitalWrite(ledArray,LOW);
//}
//}
//else {
//for(int i=5;i>=0;i--){
//digitalWrite(ledArray,LOW);
//}
//}
//}*_