DataLogger Trouble
Heavy
Posts: 6
Hello, I'm trying to use DataLogger_UART_Driver to make a usb datalogger. When I try to write data as I sample it, I can only sample at 10Hz to 20Hz. In an effort to try to sample faster, I am trying to write data to a variable at about 100Hz or so , then write it at 10Hz. But I'm having trouble writing the data to a variable. Here's my code.
This works until tic reaches 20. Then everything goes haywire. What am I doing wrong?
VAR long data[noparse][[/noparse]200] OBJ Num : "Numbers" PST : "Parallax Serial Terminal" DLG : "DataLogger_UART_Driver" PUB DataGetter(filenm) | tic, ptc tic := 0 repeat while tic < 50 ptc := num.tostr(INA[noparse][[/noparse]7], num#dec) bytemove(data + strsize(data) , ptc, strsize(ptc) + 1) tic++ waitcnt(clkfreq/100 + cnt)
This works until tic reaches 20. Then everything goes haywire. What am I doing wrong?
Comments
I'll bet you're used to programming in C where, if you give the name of an array, the compiler provides the address of the first element.· In Spin, you get the contents of the first element.
·