Example #1
0
        public static void Main()
        {
            //Debug.EnableGCMessages(true);

            InitializeLCDScreen();
            InitializeResources();

            HelloWasteland();

            var geigerCounter = new GeigerCounter(Pins.GPIO_PIN_D7, Stats);

            geigerCounter.Start();

            while (true)
            {
                Thread.Sleep(1000);

                Trace.Print("Rnd=" + geigerCounter.GetRandomNumber().ToString());

                if (_updateLCD)
                {
                    _updateLCD = false;
                    WriteLCD(LcdCommandClearScreen + _cpm10Seconds);
                }

                if (_updateTwitter)
                {
                    _updateTwitter = false;

                    if (_cpmPreviousAverage != _cpmAverage)
                    {
                        _cpmPreviousAverage = _cpmAverage;

                        Text.Clear();
                        Text.Add(GetUtcTimestamp());
                        Text.Add(",Lat=" + _latitude);
                        Text.Add(",Long=" + _longitude);
                        Text.Add(",Rnd=" + geigerCounter.GetRandomNumber());
                        Text.Add(",AverageCPM(Hour)=" + _cpmAverage);

                        TwitterStatusUpdate(Text);
                    }
                }
            }
        }
        public static void Main() {

            //Debug.EnableGCMessages(true);

            InitializeLCDScreen();
            InitializeResources();
            
            HelloWasteland();

            var geigerCounter = new GeigerCounter(Pins.GPIO_PIN_D7, Stats);
            geigerCounter.Start();

            while (true) {
                Thread.Sleep(1000);

                Trace.Print("Rnd=" + geigerCounter.GetRandomNumber().ToString());

                if(_updateLCD){
                    _updateLCD = false;
                    WriteLCD(LcdCommandClearScreen + _cpm10Seconds);
                }

                if(_updateTwitter) {
                    _updateTwitter = false;

                    if (_cpmPreviousAverage != _cpmAverage) {
                        _cpmPreviousAverage = _cpmAverage;

                        Text.Clear();
                        Text.Add(GetUtcTimestamp());
                        Text.Add(",Lat=" + _latitude);
                        Text.Add(",Long=" + _longitude);
                        Text.Add(",Rnd=" + geigerCounter.GetRandomNumber());
                        Text.Add(",AverageCPM(Hour)=" + _cpmAverage);

                        TwitterStatusUpdate(Text);
                    }
                }
            }
        }