terminal: +chvili pockat, asi zbytecne, jen aby to bylo videt na portu
[lptgpib.git] / controler.c
1 #include "lptgpib.h"
2 #include <unistd.h> /* sleep */
3
4 #define ADDRESS 7
5 int main(int argc, char **argv){
6         lptgpib_init(0x378);
7         
8         for (;;) {
9                 char buf[256];
10                 
11                 lptgpib_command(DCL);
12                 lptgpib_write(ADDRESS, "R0G1X\x0a");
13                 lptgpib_read(ADDRESS, buf, sizeof(buf));
14                 sleep(1);
15         
16                 lptgpib_command(DCL);
17                 lptgpib_write(ADDRESS, "F0X\x0a");
18                 lptgpib_read(ADDRESS, buf, sizeof(buf));
19                 sleep(1);
20         }
21 }