arduino:sim900
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| arduino:sim900 [2017/04/23 17:30] – aistis | arduino:sim900 [2017/05/08 16:25] (current) – aistis | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| http:// | http:// | ||
| + | |||
| + | https:// | ||
| < | < | ||
| Line 11: | Line 13: | ||
| #include < | #include < | ||
| - | |||
| SoftwareSerial GPRS(7, 8); | SoftwareSerial GPRS(7, 8); | ||
| - | unsigned char buffer[64]; // buffer array for data recieve over serial port | ||
| - | int count=0; | ||
| void setup() | void setup() | ||
| { | { | ||
| GPRS.begin(19200); | GPRS.begin(19200); | ||
| Serial.begin(19200); | Serial.begin(19200); | ||
| - | |||
| } | } | ||
| void loop() | void loop() | ||
| { | { | ||
| - | if (GPRS.available()) | + | if (GPRS.available()) |
| - | | + | |
| - | while(GPRS.available()) // reading data into char array | + | |
| - | { | + | |
| - | buffer[count++]=GPRS.read(); // writing data into array | + | |
| - | if(count == 64)break; | + | |
| - | } | + | |
| - | Serial.write(buffer, | + | |
| - | clearBufferArray(); | + | |
| - | count = 0; // set counter of while loop to zero | + | |
| - | + | ||
| - | + | ||
| - | } | + | |
| if (Serial.available()) | if (Serial.available()) | ||
| GPRS.write(Serial.read()); | GPRS.write(Serial.read()); | ||
| } | } | ||
| - | void clearBufferArray() | + | |
| - | { | + | |
| - | for (int i=0; i< | + | |
| - | { buffer[i]=NULL; | + | |
| - | } | + | |
| </ | </ | ||
arduino/sim900.1492957855.txt.gz · Last modified: by aistis
