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 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 last
JatinderBir Singh Chawla
UnHappy1

posted on 2021/07/08 08:20:48 AM CEST

Graphics & LCD

Ultrasonic oxygen purity and flow sensor code for PIC family

LCD or seven segment display Purity and Flowmeter

Mohd Redha Abd Aziz
redhaaziz87

posted on 2021/06/25 04:28:20 PM CEST

Measurement

Looking adruino code library for Click

Hi,

I'm looking for adruino library code for VCT monitor Click and Temperature Click

Charles Chilumbu
charleschilumbu

posted on 2021/06/19 11:30:18 AM CEST

Audio & Speech

RTC2 click Code

I have an EasyPIC v8 development board with a PIC18F45K22. I also have a RTC2 click. I am requesting for mikroC code to display real time and date on 2x16 LCD mounted on EasyPIC v8 development board. The time and date can be adjusted (set) The RTC2 click should be on micro bus 1 so that it uses R4 and R3. I would appreciate if all the include files and the main project .c file are in one folder.

Raman Sareen
Raman

posted on 2021/04/16 07:15:44 PM CEST

Mixed signal > Measurements

Sweep Generator

help for code for 89c2051 based sweep generator with 3 Khz to 33 khz frequency 50% duty cycle 3 Khz stepping and 1000 mS delay between steps.

Ankur Arora
anqurarora

posted on 2021/03/16 10:26:54 PM CET

Interface > I2C

SHT31 with P24EP512GU810

Hi,

I recently bought Easy PIC Fusion 7 Development board and trying to interface SHT31 Sensor with Microcontroller P24EP512GU810 using MikroC. I have been trying from last couple of days but no luck yet. Any kind of help will be much appreciated. I am not using the in built library because I dont have the SHT3x click and, I am using SHT31 probe from DFRobot (https://wiki.dfrobot.com/SHT31_Temperature_Humidity_Sensor_Weatherproof_SKU_SEN0385). Below is my code:

unsigned int t_m=0, t_l=0, t_c=0, h_m=0, h_l=0, h_c=0;


void SHT31_measure() {
I2C2_Start(); // issue I2C start signal

if(I2C2_Write(68)==0){ // send byte via I2C + W (command to SHT31)
UART1_Write_Text("Yes");
}
else UART1_Write_Text("No");
I2C2_Write(0x2c); // Single Measurement Mode
I2C2_Write(0x06); // Clock Streching Enabled / High Rpeatability
I2C2_Stop();

Delay_ms(5);

I2C2_Start();
I2C2_Write(69); // send byte via I2C + R (command to SHT31)

Delay_ms(200); // Wait for measurement to be done

t_m = I2C2_Read(0); // Temperature MSB and Send Acknowledge
t_l = I2C2_Read(0); // Temperature LSB and Send Acknowledge
t_c = I2C2_Read(0); // Temperature CRC and Send Acknowledge
h_m = I2C2_Read(0); // Humidity MSB and Send Acknowledge
h_l = I2C2_Read(0); // Humidity LSB and Send Acknowledge
h_c = I2C2_Read(1); // Humidity CRC and Send Not Acknowledge
I2C2_Stop();

UART1_Write_Text("Data Read Done");
UART1_Write(13);
UART1_Write(10);

}
void main() {
// Setting output frequency to 140MHz
PLLFBD = 70; // PLL multiplier M=70
CLKDIV = 0x0000; // PLL prescaler N1=2, PLL postscaler N2=2

ANSELA = 0x00; // Convert all I/O pins to digital
ANSELB = 0x00;
ANSELC = 0x00;
ANSELD = 0x00;
ANSELE = 0x00;
TRISA = 0x00; // Make port A as Output

PPS_Mapping(100, _INPUT, _U1RX); // Sets pin RP100 to be Input, and maps U1RX to it
PPS_Mapping(101, _OUTPUT, _U1TX); // Sets pin RP101 to be Output, and maps U1TX to it

UART1_Init(56000); // Initialize UART module at 56000 bps
Delay_ms(100); // Wait for UART module to stabilize
I2C2_Init(100000); // Initialize I2C @ 100KHz
Delay_ms(100); // Wait to stabalize


UART1_Write_Text("Start");
UART1_Write(13);
UART1_Write(10);

while (1) { // Endless loop

SHT31_measure(); // Measure Temperature and Humidity

UART1_Write(t_m); // Display all the data received (Raw Data), except 2 CRC Bytes
UART1_Write_Text("|") ;
Delay_ms(10);

UART1_Write(t_l);
UART1_Write_Text("|") ;
delay_ms(10);

UART1_Write(h_m);
UART1_Write_Text("|") ;
delay_ms(10);

UART1_Write(h_l);
UART1_Write(13);
UART1_Write(10);

delay_ms(1000); // Wait here for a Second

}
}

first | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 last