c - how to write the character value from structure into the serial interface and convert into integer value? -


struct memorytag1;  typedef struct memorytag1{     char a[8]= {'+','0','2','6','.','5','ea','\r'}; // setpoint temperature value     char b[8]= {'-','0','2','4','.','5','eb','\r'};     char c[6]= {'+','0','2','0','ec','\r'};     }memory1; 

// message structure want transfer on serial interface (rs232) , later convert integer value. please guide me in this.

your syntax bit off - try this:

// declare memory1 struct type hold data  typedef struct memorytag1 {     char a[9]; // setpoint temperature value     char b[9];     char c[7]; } memory1;  // allocate , initialise memory1 struct  memory1 m = { {'+','0','2','6','.','5','e','a','\r'},               {'-','0','2','4','.','5','e','b','\r'},               {'+','0','2','0','e','c','\r'} }; 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -