Geozone example
Geozone_example
#include <io>
#include <read>
#include <float>
#include <string>
#include <core>
#include <write>
#include <define>
#include <socket>
new geozone = 0;
main(){
Delay(2000); // Delay 2s
Init(RS232, 9600, WORDLENGTH_8, STOPBITS_1, PARITY_NONE); // Init RS232, Baud rate: 9600, Word length: 8bit, Stop bit: 1, Parity: none
Wait_GPS(); // Wait until get GPS coordinates
Delay(1000); // Delay 1s
write_buf(RS232,12,"Geozone test"); // Print text
while(1){
geozone = get_val(Sensor_SignalGeozoneInside);
if(geozone == 1){
write_buf(RS232,20,"You are in the geozone\r\n"); // Print text
}else{
write_buf(RS232,24,"You are not in the geozone\r\n"); // Print text
}
Delay(1000); // Delay 1s
}
}
Wait_GPS(){
new stat = 0;
while(stat < 5){
stat = get_val(Sensor_Satelites);
Delay(1000);
}
}