- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using PSoC 4 to develop a sensor. I need to timestamp the data I read, then I will only send the peaks and their timestamps to a mobile phone.
When I code:
#include<AFE4403_Sample.h>
#include<time.h>
#include <sys/time.h>
// afe4403 sample data
void AFE4403_Sample(int *num, uint32 (*data)[350])
{
uint32 temp1;
int n=0;
time_t stop,start;
double Timestamp[350];
start=time(NULL);
if (*num<50) // num = 340 when work; num = 34 when debug
{
while(n<350)
{
temp1=BLE_AFE4403_ReadData(0x2A,0x00); /
temp1=temp1& 0xffffff; //set the highest two bits to 0
CyDelay(10);
stop=time(NULL);
Timestamp
(*data)
n++;
}
}
}
My Timestamp[350] array will have 350 times the same value. Does anyone know how to get the time difference between the start of AFE4403_Sample and the reading of my data?
Regards,
Elias
Solved! Go to Solution.
- Labels:
-
BLE
-
ispn:30661:0.885:0
-
l1:314:0.885:0
- Tags:
- timestamp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will need to maintain your own time. When you need an absolute time stamping have a look at the RTC Component.
When only a relative time is needed a Timer component which fires an interrupt to update the current time will do.
Bob