But I can not solve 2 problems.
(Problem 1) There is no output signal.
I got a clone of "Test/generate" from github.
https://github.com/RedPitaya/RedPitaya/ ... t/generate
I made a executable file "generate" and run it from command-line via terminal on PC like this.
Code: Select all
./generate 1 1.99 100000 sine 0
Then , I tried accessing a web page from PC to board and just once turn on generate application.
After this procedure, the board can output signal from command-line.
I want to run it without web access.
(Problem 2) Can not sample signal.
I got a clone of "apps-free/spectrum" from github.
https://github.com/RedPitaya/RedPitaya/ ... e/spectrum
I modified main.c to add main function that calls rp_app_init() and rp_get_signals() like this.
Code: Select all
void main(void){
float ***s;
s = malloc(sizeof(float *)*SPECTR_OUT_SIG_NUM);
for(int i=0;i<SPECTR_OUT_SIG_NUM;i++)
{
s[i]=malloc(sizeof(float *)*1);
s[i][0]=malloc(sizeof(float *)*SPECTR_OUT_SIG_LEN);
}
int sig_num=0;
int sig_len=0;
float freq_cha=0;
rp_app_init();
rp_get_signals( s, &sig_num, &sig_len, &freq_cha);
printf("peak freq= %1.6f\n",freq_cha);
}
A Makefile was also modified to remove "-shared" flag and change a executable file name to "spectrum".
I connected a SG and ch1 of RX. The signal is 100KHz 1Vpp CW.
I tried run this program like this,
Code: Select all
./spectrum
I want to know how to sample signal using only C code.
Can anyone help me?
Thanks