masa miya / Mbed 2 deprecated GPIB_Controller

Dependencies:   TextLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /* GPIB Adapter 2011/06/10 MLabo */
00002 char init_msg1[]="  GPIB Cont.\n";
00003 char init_msg2[]="V0.01 11/6 MLabo\n";
00004 
00005 #include "mbed.h"
00006 #include "TextLCD.h"
00007 #include <GPIB_9914.h>
00008 
00009 TextLCD lcd(p24, p26, p27, p28, p29, p30);
00010 
00011 #define     my_address  0           //My GPIB address
00012 
00013 int main() {
00014 int data_len;
00015     lcd.cls();
00016     lcd.locate(0,0);
00017     lcd.printf(init_msg1);
00018     lcd.locate(0,1);
00019     lcd.printf(init_msg2);
00020     wait(1.0);
00021 
00022     lcd.cls();
00023     GPIB_Init(my_address);
00024     GPIB_IFC();  
00025     while(1){
00026         GPIB_REMOTE(23);         
00027         GPIB_OUTPUT("F1 R2", 23);
00028 
00029         lcd.locate(0,0);
00030         lcd.printf("Get Message1!   "); 
00031         data_len = GPIB_ENTER(databuff, 23);
00032     
00033         lcd.locate(0,1);
00034         lcd.printf("%2d %s", data_len, databuff);
00035 
00036         GPIB_LOCAL(23);
00037         wait(1);
00038     }//while
00039 }//main
00040 //End