From bc91ee702ef6a1b913bdde4964fad97d0dee5c3c Mon Sep 17 00:00:00 2001 From: James Devine Date: Sat, 31 Dec 2016 02:09:02 +0100 Subject: [PATCH] --- CosmicScanner | 52 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/CosmicScanner b/CosmicScanner index 170802a..8edc862 100644 --- a/CosmicScanner +++ b/CosmicScanner @@ -1,6 +1,9 @@ //Cosmic Pi histogram program //this compiles histograms from the ADC for different HV Bias levels //it is used to profile the detection of muons and noise +//updated to give horizontal row output rather than columns, easier to process +//only prints values from 500 to 1500 +//the first set of samples seem to be noisy for some reason (?) unsigned long start_time; unsigned long stop_time; @@ -57,10 +60,28 @@ void setup() { void loop() { //reads in on channel 0 + Serial.print("index"); + Serial.print("; Ch A & B; "); + + for (int i = 500; i < 1500; i++) { + //Serial.print(i); + Serial.print(i); + Serial.print("; "); + //Serial.println(histogramb[i]); + //Serial.print("; "); + + } + Serial.println(); + for (hvset = 0x70; hvset > 0x50; hvset--) { returnValue = bitBang(hvset); // Transmit data + for (int i = 0; i < 4096; i++) { + histograma[i] = 0; + histogramb[i] = 0; + } + for (int j = 0; j < 100000; j++) { for (int i = 0; i < 1000; i++) { @@ -80,20 +101,33 @@ void loop() { histogramb[int(values[i + 1000])]++; } } - for (int i = 0; i < 4096; i++) { + Serial.print(hvset); + Serial.print("; Ch A; "); + + for (int i = 500; i < 1500; i++) { - Serial.print(hvset); - Serial.print("; "); - Serial.print(i); - Serial.print("; "); + //Serial.print(i); Serial.print(histograma[i]); Serial.print("; "); - Serial.println(histogramb[i]); + //Serial.println(histogramb[i]); + //Serial.print("; "); + } - for (int i = 0; i < 4096; i++) { - histograma[i] = 0; - histogramb[i] = 0; + Serial.println(); + Serial.print(hvset); + Serial.print("; Ch B; "); + + for (int i = 500; i < 1500; i++) { + + //Serial.print(i); + //Serial.print(histograma[i]); + //Serial.print("; "); + Serial.print(histogramb[i]); + Serial.print("; "); + } + Serial.println(); + //Serial.println(cyclecounter); // delay(2000);