Search found 71 matches

by crocu
30 Sep 2010 14:01
Forum: mikroC General
Topic: How to divide int ?
Replies: 4
Views: 2173

Re: How to divide int ?

Can someone help me please ?
by crocu
30 Sep 2010 14:00
Forum: mikroC General
Topic: Problem with custom characters on LCD
Replies: 3
Views: 3816

Re: Problem with custom characters on LCD

Many thanks , it works fine now.
by crocu
30 Sep 2010 13:34
Forum: mikroC General
Topic: Newbie question about push button interrupt code snippet
Replies: 3
Views: 2312

Re: Newbie question about push button interrupt code snippet

Thanks, but this example is not working with interrupts , isn't ?
by crocu
29 Sep 2010 14:14
Forum: mikroC General
Topic: Newbie question about push button interrupt code snippet
Replies: 3
Views: 2312

Newbie question about push button interrupt code snippet

Hello, I'm using a 18F2620 and would like to get 2 interrupts for 2 push buttons . ( BP is pulled-up high with resistance, the level gets down when BP is pressed ) I need one task to be done when BP1 (connected to RC6) is pressed, and do another task when BP2 ( connected to RC7) is pressed. In fact,...
by crocu
26 Sep 2010 11:32
Forum: mikroC General
Topic: Problem with custom characters on LCD
Replies: 3
Views: 3816

Problem with custom characters on LCD

Hello I need to have 3 differents custom characters in my project, here is the code for each of them : // Custom character : ° const char degre[] = {6,9,9,6,0,0,0,0}; void symbol_degre(char pos_row, char pos_char) { char i; LCD_Cmd(64); for (i = 0; i<=7; i++) LCD_Chr_Cp(degre[i]); LCD_Cmd(LCD_RETURN...
by crocu
26 Sep 2010 10:48
Forum: mikroC General
Topic: How to calculate "G" value from 3 Axis Accelerometer Board ?
Replies: 2
Views: 1622

Re: How to calculate "G" value from 3 Axis Accelerometer Boa

Yes, i found it G measurement is calculated with this line : void Read_Angles() { double div_x, x_rad, div_y, y_rad, div_z, z_rad ; div_z = (float)(meas_z-zeroG_z) / (oneG_z-zeroG_z); // measured_G / one_G ... } But my problem is to display div_z value on my LCD display with 1 digit after comma , li...
by crocu
23 Sep 2010 21:45
Forum: mikroC General
Topic: How to calculate "G" value from 3 Axis Accelerometer Board ?
Replies: 2
Views: 1622

How to calculate "G" value from 3 Axis Accelerometer Board ?

Hello I would like to add "G-meter" function working with Three-Axis Accelerometer Board. MikroElektronika provides a code example to calibrate and measure angles on each axis : ( http://www.mikroe.com/eng/downloads/get/168/accelboard_examples_v101.zip ) Has someone already built a project to get "G...
by crocu
23 Sep 2010 09:18
Forum: mikroC General
Topic: How to divide int ?
Replies: 4
Views: 2173

Re: How to divide int ?

The calculation result should be from -10.0 to +10.9 then, i would like to display result like this : +xx.x or -xx.x I would like to display 1 digit after comma : if i proceed like this, it it correct ? But i don't know how to find out if result will be + or - signed ... i need to display the sign (...
by crocu
18 Sep 2010 11:51
Forum: mikroC General
Topic: How to divide int ?
Replies: 4
Views: 2173

How to divide int ?

Hello I'm reading a ADC value and need to do some calculations : When i try do display on my LCD the result called "g_long" Expected result is not correct, can you tell me what is wrong with this line please ? :? g_long = (((long)z_read - c) / s); Here is code snippet i use for declarations and calc...
by crocu
16 Sep 2010 20:28
Forum: mikroC General
Topic: Help regarding ADC calculations for MMA7260
Replies: 2
Views: 2026

Re: Help regarding ADC calculations for MMA7260

Hello, i'm still trying to write a code to perform calculations and display a gravity variable called "Gvalue" The code needs to divide ADC value issue from sensor by 163. ( G_SENSITIVITY ) My code compiles properly but calculation shoud not be correct because "Gvalue" result always display 0.00 , c...
by crocu
15 Sep 2010 20:19
Forum: mikroC General
Topic: Help regarding ADC calculations for MMA7260
Replies: 2
Views: 2026

Help regarding ADC calculations for MMA7260

Hello I'm novice with C programming and i need to some help to do some calculation written in C code. I'm using an acceleration module MMA7260Q that delivers a voltage depending the gravity measurement. I would like to display how many 'G' my module measures : I'm able to display the voltage issued ...
by crocu
06 Jun 2010 21:31
Forum: mikroC General
Topic: Having problem to declare AN pins with 18F2620
Replies: 2
Views: 1865

Having problem to declare AN pins with 18F2620

Hello, I'm using 18F2620 and i need to use 4 x analog inputs : RA0 - RA1 - RA2 - RA3 I declared ANCON1 as follow but it won't work : ADCON1 = 0x0E; // Set AN0 to AN3 as analog channels ADCON1= 0x82; // configure VDD as Vref, and analog channels It compiles with no errors but Pic freezes, can you tel...
by crocu
06 Jun 2010 17:58
Forum: mikroC General
Topic: Pb : Simple LCD test code and 18F2620 : maybe wrong fuses ?
Replies: 6
Views: 2449

Re: Pb : Simple LCD test code and 18F2620 : maybe wrong fuse

Thanks, i found this in the list :

PBADEN_OFF_3H = $00FD
PBADEN_ON_3H = $00FF

Should i set : PBADEN_ON_3H ?
by crocu
06 Jun 2010 13:39
Forum: mikroC General
Topic: Pb : Simple LCD test code and 18F2620 : maybe wrong fuses ?
Replies: 6
Views: 2449

Re: Pb : Simple LCD test code and 18F2620 : maybe wrong fuse

Thanks, but i can't find where i should change RB4 in Edit Project window ...

Is it in the device flag list ?

How it is called ?

I'm using MikroC for PIC , version: 8.2.0.0
by crocu
04 Jun 2010 13:25
Forum: mikroC General
Topic: Pb : Simple LCD test code and 18F2620 : maybe wrong fuses ?
Replies: 6
Views: 2449

Pb : Simple LCD test code and 18F2620 : maybe wrong fuses ?

Hello I'm using a 18F2620 with 10 Mhz crytal + 2 x 18pf caps. I connected on port B a LCD and only would like to display a test message on it. When powering up the Pic initialises the LCD but nothing is been displayed. I think there is something wrong with my fuses settings. Can you tell me what i s...

Go to advanced search