| 전자부품 데이터시트 검색엔진 |
|
433MHZ 데이터시트(PDF) 4 Page - List of Unclassifed Manufacturers |
|
|
|||||||||||||||||||||||||||||
433MHZ 데이터시트(HTML) 4 Page - List of Unclassifed Manufacturers |
|
4 / 15 page ![]() if (!driver.init()) Serial.println("init failed"); } void loop() { const char *msg = "Hello World!"; driver.send((uint8_t *)msg, strlen(msg)); driver.waitPacketSent(); delay(1000); } How the transmitter sketch works First, we need to include the RadioHead ASK library. #include <RH_ASK.h> This library needs the SPI library to work. So, we also need to include the SPI library. #include <SPI.h> After that, we create a RH_ASK object called driver. In the setup() we initialize the RH_ASK object by using the init() method. We use an ifstatement and a print in the Serial Monitor for debugging purposes. Serial.begin(9600); // Debugging only if (!driver.init()) Serial.println("init failed"); In the loop(), we write and send our message. Here, our message is saved on the msgvariable. Please note that the message needs to be a char type. const char *msg = "Hello World!"; This message contains the “Hello World!” message, but you can send anything you want as long as it is in char format. Finally, we send our message as follows: driver.send((uint8_t *)msg, strlen(msg)); driver.waitPacketSent(); The message is being sent every second, but you can adjust this delay time. delay(1000); Receiver Circuit |
|
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |