Search found 4 matches

by BikerBoy
08 Jan 2010 02:31
Forum: mikroC PRO for PIC General
Topic: Convert Hex to BCD code B
Replies: 3
Views: 3463

Sorry got that the wrong way round should be

0x0102 or in binary 0000 0001 0000 0010
by BikerBoy
08 Jan 2010 02:25
Forum: mikroC PRO for PIC General
Topic: Convert Hex to BCD code B
Replies: 3
Views: 3463

Looking @ the MAX7219 Data sheet after initialisation you need to send 16 bit frames MSB first, bits 0-7 are the data (Digit[x]) bits 8-11 select the register and bits 12-15 don't care

So to send a "2" to digit 0 on the display you need to send 0x0210
or in binary 0000 0010 0001 0000
by BikerBoy
08 Jan 2010 01:52
Forum: mikroC PRO for PIC General
Topic: Convert Hex to BCD code B
Replies: 3
Views: 3463

I assume you want to split an 8 bit value into 3 decimal numbers ie max size is 255 then try something like this this char Digit[3]; Digit[0] = freqH / 100; //Divide by 100 Digit[1] = (freqH % 100) / 10; //Remainder Divided by 10 Digit[2] = (freqH % 100) % 10; //Remainder of Remainder Divided by 10 ...
by BikerBoy
08 Jan 2010 00:40
Forum: mikroC PRO for PIC General
Topic: Declaring an array sized to a variable?
Replies: 1
Views: 1348

Variables are not normally allowed when declaring arrays because the compiler needs to know how big the array is so that it can allocate memory for the array. Also variables are usually initialised to 0 by the compiler otherwise they could contain garbage this would mean that your array could start ...

Go to advanced search