Beispiel #1
0
        public static void Main()
        {
            // InitializeDisplay();
            // DisplayStatus(0, "Potentiometer value:");

            AnalogIn pot = new AnalogIn((AnalogIn.Pin)FEZ_Pin.AnalogIn.An2);

            Credentials      auth       = new Credentials("admin", "admin");
            string           hubId      = "54f239b1801d90881e9d15be";
            DataPointService dataPoints = new DataPointService(auth, "adminProject", hubId, 5000);

            dataPoints.ConfigureForDevelopment("");

            // Start communications
            dataPoints.Start();

            while (true)
            {
                // Measure potentiometre value
                int potValue = pot.Read();

                // Display current value on screen
                // DisplayStatus(1, FormatValue(potValue));

                // Push current value to the data service
                Number number = new Number(potValue);
                dataPoints.PushDataPoint(number);

                // Wait before next measurement
                Thread.Sleep(3000);
            }
        }
 public ManageDataPointController()
 {
     dataPointService = new DataPointService(MvcApplication.DocumentStore);
 }
Beispiel #3
0
 public DataPointController(ILogger <DataPointController> logger, DataPointService dataPointService)
 {
     _logger           = logger;
     _dataPointService = dataPointService;
 }