Am Freitag, 2. Januar 2015 15:08:07 UTC+1 schrieb [email protected]:
>
> Hey TJF,
>
> When possible, can you tell me something about my results when I got the
> sample rate using the CAP pin?
>
Hi Luciano,
sorry, I can't, because I don't understand your code. The sequence
#define P1 P9_14
#define P2 P9_42
int main(int argc, char **argv)
{
pruIo *Io = pruio_new(PRUIO_DEF_ACTIVE, 0, 0, 0); //! create new
driver structure
if (Io->Errr) {
printf("initialisation failed (%s)\n", Io->Errr);}
if (pruio_cap_config(Io, P1, 2.)) { // configure input pin
printf("failed setting input @P_IN (%s)\n", Io->Errr);}
...
should through an error since P1 (= P9_14) has no CAP capability. Why don't
you stop the program in case of that error? And where is the error message
in your output picture? Are you sure you did run that code?
Also
...
if (pruio_cap_Value(Io, P1, &f1, &d1)) { // get
current input
printf("failed reading input @P1 (%s)\n", Io->Errr);
}
printf("\r Frequency: %10f , Duty: %10f ", f1, d1); //
info
...
cannot work due to the same reason (missing CAP capability of P1) and
should through error messages. You should have used P2 in both cases.
BR
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.