Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: Smart Parking
PostPosted: Wed Apr 18, 2012 12:09 pm 

Joined: Tue Mar 13, 2012 4:54 pm
Posts: 18
Hello Libelium.

I have a problem with the smartparking sensor. When I execute this code:
Quote:
#define ADDRESS "0013A20040763C97"
#define TIME "00:00:00:30"
int temperature;
boolean status;


char aux[200]= "Prueba";
packetXBee* paq_sent; 
#define key_access "LIBELIUM"

void setup()
{

  
SensorParking.loadReference();
SensorParking.setBoardMode(SENS_ON);

delay(2000);
SensorParking.calibration();
SensorParking.setBoardMode(SENS_OFF);
RTC.ON();
PWR.deepSleep(TIME,RTC_OFFSET,RTC_ALM1_MODE1,ALL_OFF);
}
void loop()
{
  
 
  
  
SensorParking.setBoardMode(SENS_ON);

SensorParking.readParkingSetReset();
temperature = SensorParking.readTemperature();
SensorParking.calculateReference(temperature);
status = SensorParking.estimateState();
xbee802.init(XBEE_802_15_4,FREQ2_4G,NORMAL);
xbee802.ON();
if(status == PARKING_OCCUPIED){
xbee802.send(ADDRESS,"Ocupada\n");
Utils.setLED(LED0, LED_ON);
delay(1000);
}else{
xbee802.send(ADDRESS,"LIBRE\n");
Utils.setLED(LED0, LED_OFF);
delay(1000);
}
delay(100);
xbee802.OFF();
RTC.ON();
//PWR.deepSleep(TIME,RTC_OFFSET,RTC_ALM1_MODE1,ALL_OFF);
}




I obtain always that the place is ocuppied and I dont understand why.
Thankyou.


Top
 Profile  
 
 Post subject: Re: Smart Parking
PostPosted: Thu Apr 19, 2012 8:59 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7475
Hi _maria_,

could you please add a small delay after turning on the board and before reading the sensors?

Something like this:

Code:
SensorParking.setBoardMode(SENS_ON);
delay(10);
SensorParking.readParkingSetReset();


Try this solution and let us know if it worked.

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use