Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

Sort By

USER REQUESTS

first | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 last
Rodrigo Silva
rodrigo_rodrigues789

posted on 2014/10/17 04:28:03 AM CEST

Other Codes

Problems using the ASIN function using variables

Hello,
I'm using the accelerometer MMA7361 to convert the slope in degrees.
I'm having problems doing the following equation by the compiler:

degrees = asin ((reading1 - 1.65) / 0.8; // this formula was removed from the Freescale website "Aplication Note AN3107 - Measuring Tilt with Low-g Accelerometers"

where:
degrees (Float)
Reading1 (int) used to convert A / D value in tension.

The value shows only "0" and not know why. I think there is a problem with my variable or the "asin" function.

........................................Program.......................................................................
while (1){

Leitura = Adc_Read(0); //Faz a leitura do canal AN0 (X)
Leitura = Leitura / 0.20459; //a variável Leitura. Faz em seguida a operação
IntToStr(Leitura, texto); //para apresentar o valor entre 0 a 5000mV
Glcd_Write_Text(texto, 40, 3, 1);

//Transformar em Graus
Leitura1 = Adc_Read(0); //Faz a leitura do canal AN0 (X)
Leitura1 = Leitura1 / 0.20459; //a variável Leitura. Faz em seguida a operação

graus = asin ((Leitura1 - 1.65) / 0.8;

IntToStr(graus, texto1);
Glcd_Write_Text(texto1, 40, 5, 1);
delay_ms(250);

if (graus > 40) {
RELE = 1;
LED = 1;
}
else {
RELE = 0;
LED = 0;
}

}
}


Harish Muralidhara
hmuralid

posted on 2014/10/15 07:44:41 PM CEST

Measurement

SPI code for Thermo Click and Clicker2 board

I am trying to interface the THERMO clicker with the clicker2 board which has the STM32F407VGT6 MCU. I am using the first microbus slot and I have put in a K thermo couple probe into the THERMO clicker. I have initialized SPI3 and I have tried both SPI_Read and SPI3_Read functions. But I observed that the program is stuck in an infinite loop in the SPI read block. Can you please let me know what is the problem?

Thanks!

Kristijan Krsteski
antineutrino

posted on 2014/10/11 04:11:33 PM CEST

Measurement

LightHz click on Arduno Uno

If possible can I have example ino or pde file for Arduino IDE to start LightHz click board!
How to convert hex to arduino code?
HEX file to INO or PDE, how to on this example will be helpfull?
Thanks

Sonal Bora
sonal

posted on 2014/10/10 12:02:14 PM CEST

Measurement

Color Click code for stm8

I am using Color Click module with STM8S board referring to the code at http://www.libstock.com/projects/view/780/color-click-example. But I am not getting correct output. e.g. for blue object, I am getting output as Pink/Purple color mot of the times.
In fact the output is very random. I am getting different colors as output.

Has any one used Color Click module successfully? Please share your code.

Thanks

Michael Havenga
Dxmaxim

posted on 2014/10/09 05:46:52 AM CEST

Communication > Ethernet

ETHERNET Library BUG Fix.


Hey All,

The Mikroe ETHERNET library does seem to contain a bug which results in the Ethernet functionality not working or freezing.

1) I am requesting that someone who knows how repair the bug

2) Has an alternative Ethernet library that they can suggest or supply

If you need to review the history of the issue, please review the comment History on the Ethernet Library. Let me know.

Michael

first | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 last