11. IoT OS
mbed OS
We are creating a modern full-stack operating system that is
designed specifically for ARM Cortex®-M-based MCUs; the
worlds leading 32-bit microcontrollers that already sell in the
billions.
mbed Device Server
Analogous to a Web Server that accepts connections from
mobile phones or web browsers, a Device Server handles the
connections from IoT devices.
mbed Tools
online compiler (Web IDE) etc.
13. Analogous to a Web Server that accepts connections from
mobile phones or web browsers, a Device Server handles
the connections from Internet of Things (IoT) devices.
A Device Server is a key enabler for cloud service providers, operators and
enterprises to access the IoT growth market with production deployments,
bringing end node devices in to the world of web services.
39. 使⽤用 AnalogIn API 讀取旋轉⾓角度。
#include "mbed.h"
AnalogIn RotaryAngle(p15);
int main()
{
int value = 0 ;
value = RotaryAngle;
}
Grove - Rotary Angle Sensor
範例:
48. 使⽤用 AnalogIn API 讀取 Temperature Sensor 的資料,依 Temperature Sensor 的 datasheet 轉換出溫度。
#include "mbed.h"
AnalogIn device(p15);
int a;
float temperature;
int B = 3975; // B value of the thermistor
float resistance;
int main()
{
while(1) {
a = device * 675; // multiply ain by 675 if the Grove shield is set to 5V or 1023 if set to 3.3V
resistance = (float)(1023-a)*10000/a; // get the resistance of the sensor;
temperature = 1/(log(resistance/10000)/B+1/298.15)-273.15; // convert to temperature via datasheet ;
wait(0.8);
}
}
Grove - Temperature Sensor
範例: