Hello.
This is my first project using Arduino.
I need to send sensor data from arduino to Microsoft Azure IoT Hub. However, I am unable to connect arduino to azure. I couldn't find any useful tutorial so I'm asking here.
I connected temperature sensor using tinkerkit sensor shield and I'm getting data in arduino serial monitor, so that's ok I guess.
Also, I have obtained student license for using Microsoft Azure. As I said before, now I need to connect my arduino to IoT Hub and get data from it. Here is my code:
P.S. I'm using windows 10
// include the TinkerKit library
#include <TinkerKit.h>
TKThermistor therm(I3); // creating the object 'therm' that belongs to the 'TKThermistor' class
// and giving the value to the desired output pin
float C, F; // temperature readings are returned in float format
void setup()
{
// initialize serial communications at 9600 bps
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
C = therm.readCelsius(); // Reading the temperature in Celsius degrees and store in the C variable
F = therm.readFahrenheit(); // Reading the temperature in Fahrenheit degrees and store in the F variable
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000);
// Print the collected data in a row on the Serial Monitor
Serial.print("Analog reading: "); // Reading the analog value from the thermistor
Serial.print(therm.read());
Serial.print("\tC: ");
Serial.print(C);
Serial.print("\tF: ");
Serial.println(F);
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000);
}