Do you need to define RADIO_OUT pin 21 (on your Mega?) as an INPUT or INPUT_PULLUP? I see the link's code does not define it as input, but maybe the Lilblupil has PA12 always INPUT/INPUT_PULLUP.
A note about WWWB reception. It's shortwave, conditions are highly variable. A hilltop won't help you, the signals are coming down at you from the ionosphere.
I had a few clocks that used it. They were constantly losing synch. Usually I could only find a few places in the house where they would lock on. The 3D orientation makes the biggest difference, but they are also sensitive to any EMI from other electronic devices nearby.
I assume you know, the signal is only transmitted once per minute... so moving the antenna faster than that won't prove anything.
Actually, WWVB is VLF (60 kHz). WWV is short wave.
@OP: which WWVB module do you have, with which antenna? Post a link.
The ferrite rod should be arranged so that its long axis is perpendicular to the line from you to the WWVB transmitter, and FAR AWAY from other electronics.
If you arrange for a simple LED output, you don't need an Arduino to detect WWVB reception. Just look for 1 second flashes. Best reception is at night.
Oops! Anyway, reception is usually "spotty", so you can't sync continuously. You need some kind of RTC. No matter how good the signal, there will be times it won't be there.
Good suggestion to define an input , and I did: pinMode (RADIO_OUT, INPUT);
The results are as bad as before.
Why do I have negative numbers for Pulse width?
Also , if the broadcast is once a min, why do I get a continuous string of readings?
It is not. Data bits are broadcast every second, with either full carrier, or carrier reduced levels. 60 data bits = 1 minute = one complete time/date WWVB transmission. The details are posted here.
If set up properly the radio will flash an LED every second, using either a long or short pulse, when receiving a valid WWVB signal.
EDIT: on that CANADUINO receiver, the OUT LED should flash as mentioned above. To verify reception, all you need to do is power the receiver from a 3V battery and carry it away from possibly interfering electronics.
pulseIn() returns an 'unsigned long int' (32-bit) number which you store in a 'signed int' (16-bit) variable. You have the timeout set to 2 million microseconds but any value over 32767 microseconds will overflow the 'int'.
The code linked in response #5 above will work on a Mega.
I think for the Canaduino receiver, the input pin should be connected to OUT, rather than /OUT. But if the LED indicates a good signal and one doesn't work, try the other.
That Universal Solder Canaduino module has a led marked OUT and it should blink regularly at 1 second intervals if it is getting a good signal.
Some things to be aware of. (1) It is a kit and the crystal and antenna must match the transmitter, in your case 60kHz and (2) The pin marked PDN must be tied to ground. (3) The receiver modules are very prone to local electrical interference such as noisy power supplies.
The project you are following is for a Bluepill, a 32 bit processor, and you are using a Mega which is an 8bit processor hence the problem you have already experienced with int/long. It also uses interrupts and hardware timers which are completely different between these microcontrollers. You really have to find a project which has been developed for an 8 bit Arduino board.
I have used the European (77.5kHz) version of the Canaduino module quite successfully. I even used a much bigger (20cm) home made ferrite antenna for improved reception.
And there more than a few times WWVB is off the air for various reasons. Out weather station uses WWVB for it's clock. A few weeks ago my wife noticed it was way off from the time on the other kitchen devices. I reset the weather station and it had not synced up after quite a few hours. The WWV web site gives a list of all the WWVB outages, when and how long. Quite a long list.