Page 229 - MDP2022-2
P. 229
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t *file, uint32_t line)
{
/* USER CODE BEGIN 6 */
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */
나. Arduino 코드
(1) 팬 동작 코드
#include <DHT.h>
DHT mydht(A1, DHT11);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
mydht.begin();
pinMode(3, OUTPUT);
digitalWrite(3,HIGH);
delay(4000);
}
// 초기 동작 확인 4초동안 돌리기
void loop() {
// put your main code here, to run repeatedly:
int temp = mydht.readTemperature();
int humi = mydht.readHumidity();
Serial.print("Temp : ");
Serial.println(temp);