Search found 708 matches

by Sy
24 Apr 2014 19:12
Forum: mikroC PRO for PIC General
Topic: Static storage class initialise issue
Replies: 3
Views: 945

Re: Static storage class initialise issue

The K&R book on C specifies that you should not rely on the compiler clearing static data, although most do, its good practice to do it yourself.
by Sy
24 Apr 2014 19:00
Forum: mikroC PRO for PIC General
Topic: passing arrays of pointers to a funtion
Replies: 3
Views: 1053

Re: passing arrays of pointers to a funtion

One suggestion, add a NULL as the last entry in your array of pointers: a friend asked me how to pass a array of pointers into a funtion and print the strings out from the function...i came up with this, but have a feeling there is a more direct way of doing it? thanks Code: Select all #include "pro...
by Sy
20 Apr 2014 22:06
Forum: mikroC PRO for PIC General
Topic: Struct and typedef types
Replies: 5
Views: 2888

Re: Struct and typedef types

Personally I prefer to declare the typedef in one:

Code: Select all

typedef struct Test{
        int x;
        char y;
} udtTest;
Then when using:

Code: Select all

udtTest A, B, C;
The prefix udt, tells me that its 'user defined type'.
by Sy
26 Feb 2014 20:33
Forum: mikroC PRO for PIC General
Topic: Include Javascript request in HTTP_Demo_Internal
Replies: 8
Views: 3124

Re: Include Javascript request in HTTP_Demo_Internal

Need more information, you are assuming that 'we' know what you are talking about... When you say OK Let's say that I wan't to display my IP address and a subnet mask somewhere on that page. How would I do that? Are you asking for help on how to retrieve your IP address and subnet mask from your sys...
by Sy
20 Feb 2014 22:18
Forum: mikroC PRO for PIC General
Topic: Function Pointers and Parameters
Replies: 2
Views: 1504

Re: Function Pointers and Parameters

Why the 'const' keyword?

You are a type, I'm puzzled what purpose this serves, you aren't declaring an instance of the structure.
by Sy
19 Feb 2014 20:19
Forum: mikroC PRO for PIC General
Topic: Include Javascript request in HTTP_Demo_Internal
Replies: 8
Views: 3124

Re: Include Javascript request in HTTP_Demo_Internal

I'm not sure what you were intending to do with your script, but the syntax is not valid. the src element of the script tag should refer to a document reference including the path on the server.

You should look up AJAX, then you can do exactly what you want.
by Sy
04 Feb 2014 17:12
Forum: mikroC PRO for PIC General
Topic: RS485 PC comunication con vb6
Replies: 3
Views: 1308

Re: RS485 PC comunication con vb6

Sorry, I don't and I'm not at home right now, I don't have access to the required information, sorry.

Your PIC will be able to accurately assert RTS when data is sent, Windows won't. If you were to look on a scope, with data and RTS you would see a considerable overlap on the windows side.
by Sy
04 Feb 2014 09:50
Forum: mikroC PRO for PIC General
Topic: RS485 PC comunication con vb6
Replies: 3
Views: 1308

Re: RS485 PC comunication con vb6

If you are using RS485, what protocol are you using? Is the RTS line being asserted during data transmission? If you do need to assert RTS then its unlikely if not impossible to do this in Windows due to the timer inaccuracy. You would be better off sourcing and using an RS232 to RS485 adapter that ...
by Sy
02 Feb 2014 18:15
Forum: mikroC PRO for PIC General
Topic: what is uint8_t ? same as int ?
Replies: 10
Views: 7549

Re: what is uint8_t ? same as int ?

The type uint8_t is 8 bit, the only difference between a standard type and an unsigned type, is that the Most Significant Bit of the type (MSB) in a signed type is used to indicate the sign of the type. If the MSB is set then the value is negative, if its clear then the type is positive. In an unsig...
by Sy
30 Jan 2014 09:55
Forum: mikroBasic PRO for PIC General
Topic: Ethernet demo : any /POST request sample please ?
Replies: 18
Views: 5887

Re: Ethernet demo : any /POST request sample please ?

Maybe I've misunderstood, but I thought what was being asked for was a way to interpret the HTTP data on the server once it had been posted ? If this is the case then the data will not be chunked, it will be in one contiguous data stream that can be interpreted by the code. If you what you are askin...
by Sy
29 Jan 2014 15:30
Forum: mikroBasic PRO for PIC General
Topic: Ethernet demo : any /POST request sample please ?
Replies: 18
Views: 5887

Re: Ethernet demo : any /POST request sample please ?

POST data follows after the HTTP headers, the end of the headers is indicated by \r\n\r\n (A blank line) The posted data then follows, each data item is prefixed with the name of the field the data corresponds to followed by an '=' character, the data may then be URL encoded. Multiple data items are...
by Sy
19 Jan 2014 19:36
Forum: mikroC PRO for PIC General
Topic: How to use Extern variables
Replies: 6
Views: 3225

Re: How to use Extern variables

Externals extend the scope of global variables defined in a c module. Globals should only be declared in a single C module, then external references to the globals should be placed in the header. Externals and globals should have a 1:1 relationship, if you have an external that does not have a match...
by Sy
09 Jan 2014 20:45
Forum: mikroC PRO for PIC General
Topic: Union Initialization
Replies: 5
Views: 1840

Re: Union Initialization

Looking at your type definition: typedef struct { int a; union { char b[13]; struct { float c1, c2, c3; short d; }; }; } UserStruct; UserStruct UStr[2] = { { 2, "TEST"}, // String is recognized as a string. Everything is fine { 4, { 5.0, 6.0, 7.0, 1}} // Second part is recognized as a string too {5,...
by Sy
22 Dec 2013 09:47
Forum: mikroC PRO for PIC General
Topic: strcat
Replies: 6
Views: 2762

Re: strcat

The only thing I would add is that the '&' returns the address of the item in memory. When dealing with character arrays, the string functions expect the last character in the array to be a 0 (null terminator), if they don't find this they will continue reading into memory.
by Sy
11 Dec 2013 16:03
Forum: mikroC PRO for PIC General
Topic: strcat
Replies: 6
Views: 2762

Re: strcat

The first line is correct, assuming that noisebuffer is a single dimensional array then the correct code should read:

Code: Select all

strcat(outputtelegram, &noisebuffer[5]); 
strcat will terminate at the next null, so you must take care that noise buffer terminates with a null at some location after element 5.

Go to advanced search