CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Help Using get_string!!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Christian



Joined: 11 Nov 2005
Posts: 6

View user's profile Send private message

Help Using get_string!!
PostPosted: Fri Nov 11, 2005 8:19 pm     Reply with quote

I'm trying to learn how to use serial coms. At the moment I want to send a string of character to the pic and for the pic to send them back.

The header is:

Code:
#include <16F88.h>
#device adc=8
#use delay(clock=20000000)
#fuses NOWDT,HS, NOPUT, NOMCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO
#use rs232(baud=9600,parity=N,xmit=PIN_B5,rcv=PIN_B2,bits=8,errors)


And code:

Code:
#include "C:\Documents and Settings\C\Desktop\Test\Test_5.h"
#include "C:\Program Files\PICC\Drivers\input.c"

setup_adc_ports(no_analogs);

//int string;
//string = 5;

void main()
{
int string;
printf("Start \n\r");

while(1);
   {
   get_string(string,5);
   printf("%U \n\r",string);
   }
}


Thanks
-Christian


Last edited by Christian on Fri Nov 11, 2005 9:21 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 11, 2005 8:28 pm     Reply with quote

Quote:

I'm trying to learn how to use serial coms. At the moment I want to send
a string of character to the pic and for the pic to send them back.

int string;
get_string(string,5);

Look at the CCS example file, EX_STR.C, which has an example
of how to declare the variable used as the first parameter in get_string().
You need to do it in a similar way. EX_STR.C is in this folder:
c:\Program Files\Picc\Examples
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group