Using 3204 with GCC compiler

Post any questions you may have about our current range of oscilloscopes
Post Reply
Dermot

Using 3204 with GCC compiler

Post by Dermot »

Does anyone use the 3204 with the gcc compiler. I have tried to run a test program to open the usb port, flash the LED and close the port. This is just to prove connectivity.
Can anyone give me the initial command line for gcc and do I have to link libraries etc. All files are in the same folder and output exe file is directed there.

See attached code

#include
#include
#include
#include
short handle;

/*
*
*/
int main(void) {
short handle;

handle = ps3000_open_unit();
printf("opened ");
Sleep(2000);
//handle = ps3000_open_unit(void);
printf("Handle = $%sd", handle);
ps3000_close_unit(handle);
Sleep(2000); /* keep cmd window open for 2 seconds*/
return(0);
}

Erik
PICO STAFF
PICO STAFF
Posts: 53
Joined: Mon Oct 23, 2006 8:16 am
Location: Cambridgeshire, UK

Re: Using 3204 with GCC compiler

Post by Erik »

To compile the example program the line is:

Code: Select all

gcc -lps3000 PS3000con.c -oPS3000con
-lps3000 includes the driver library
PS3000con.c should be changed to the name of your c-file
-oPS3000con specifies the name of the final binary

Have a look in the documentation for the linux SDK.
More specifically, the README and INSTALL files.

Post Reply