Jan Kamidra
/
Mbed_A9G_test
Test
main.cpp@8:f5e79684b53c, 23 months ago (annotated)
- Committer:
- JohnnyK
- Date:
- Fri Apr 08 22:00:00 2022 +0000
- Revision:
- 8:f5e79684b53c
- Parent:
- 7:90bb5b736fe4
sample library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JohnnyK | 0:aaec057956ca | 1 | #include "mbed.h" |
JohnnyK | 7:90bb5b736fe4 | 2 | #include "A9G.h" |
JohnnyK | 0:aaec057956ca | 3 | |
JohnnyK | 0:aaec057956ca | 4 | // setup |
JohnnyK | 0:aaec057956ca | 5 | int main() { |
JohnnyK | 0:aaec057956ca | 6 | printf("Mbed A9G test\n"); |
JohnnyK | 7:90bb5b736fe4 | 7 | |
JohnnyK | 7:90bb5b736fe4 | 8 | A9G a9g(PD_5,PD_6,true); |
JohnnyK | 7:90bb5b736fe4 | 9 | if(a9g.init()){ |
JohnnyK | 7:90bb5b736fe4 | 10 | if(a9g.sendSMS("+123123456789", "Hello!")) printf("sendSms success\n"); |
JohnnyK | 7:90bb5b736fe4 | 11 | else printf("sendSms failed\n"); |
JohnnyK | 4:928351381957 | 12 | } |
JohnnyK | 7:90bb5b736fe4 | 13 | else printf("module init failed\n"); |
JohnnyK | 7:90bb5b736fe4 | 14 | |
JohnnyK | 0:aaec057956ca | 15 | |
JohnnyK | 0:aaec057956ca | 16 | // loop |
JohnnyK | 0:aaec057956ca | 17 | while(true) |
JohnnyK | 0:aaec057956ca | 18 | { |
JohnnyK | 0:aaec057956ca | 19 | //do something in loop |
JohnnyK | 0:aaec057956ca | 20 | thread_sleep_for(1000); |
JohnnyK | 0:aaec057956ca | 21 | } |
JohnnyK | 0:aaec057956ca | 22 | } |