OK, Made a Muon Detector, no nanos needed. Muon Detector It works. Flashes an LED when muon detected. Can't sit there and constantly watch for the LED to blink. Need to add a counter. Before that, I needed to see if I could get a clock (via DS3231) working to keep time. With Forum help I was able to do that. Basic clock
Now that I have progressed a bit need help with the final phase- putting everything together so the OLED will display the current time and running counts of muons detected. I got a sketch from AI (I'm not able to create by myself...yet) and it does a basic count but not the way I want it. Long story so made a vid to try to explain: Muon combining everything help
Here is AI generated sketch for counter shown in the video:
OLED SDA pin to A4 on Arduino Nano
OLED SCL pin to A5 on Arduino Nano
The input pulse is connected to digital pin 2 (D2) on the Arduino Nano.
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// Constants for OLED display
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
// Constants for input pin and interrupt
#define INPUT_PIN 2
volatile int pulseCount = 0;
void setup() {
// Initialize OLED display
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
// Initialize input pin
pinMode(INPUT_PIN, INPUT);
attachInterrupt(digitalPinToInterrupt(INPUT_PIN), countPulse, RISING);
}
void loop() {
// Display the pulse count on OLED
display.clearDisplay();
display.setCursor(0, 0);
display.print("Muon Count:");
display.setCursor(0, 24);
display.print(pulseCount);
display.display();
}
void countPulse() {
pulseCount++;
}