Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-STM32F103C8T6 thermistor HMC5883L DHT11 USBDevice
main.cpp
- Committer:
- programy1
- Date:
- 2020-05-17
- Revision:
- 0:eb7b33d1b081
- Child:
- 1:f2402d1acb80
File content as of revision 0:eb7b33d1b081:
#include "stm32f103c8t6.h"
#include "mbed.h"
#include "USBSerial.h"
#include "thermistor.h"
#include "HMC5883L.h"
#include "Dht11.h"
DigitalOut led(PC_13);
Thermistor my_thermistor(ADC_TEMP, 10000, 3950, 4700);
HMC5883L wind_direction(I2C_SDA, I2C_SCL);
Dht11 temphum(PB_13);
int main()
{
confSysClock();
USBSerial usb(0x1f00, 0x2012, 0x0001, false); //init usb serial
usb.printf("\nReading temperature from internal sensor in processor\n");
while(1) {
sensor.read()
usb.printf("Thermistor = %f\n", my_thermistor.temperature());
usb.printf("Heading = %f\n", wind_direction.getHeadingXYDeg());
usb.printf("Temperature DHT11 = %f\n", temphum.getCelsius());
usb.printf("Humidity DHT11 = %f\n", temphum.getHumidity());
led = !led;
wait(1.0);
}
}