TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136815 times)
  2. FAT32 Library (69983 times)
  3. Network Ethernet Library (55953 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41892 times)
  6. FT800 Library (41202 times)
  7. GSM click (28990 times)
  8. PID Library (26420 times)
  9. mikroSDK (26376 times)
  10. microSD click (25383 times)
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]

< Back
Library

OneWire Communication Library with Search functionality

Rating:

0

Author: Anton Rieckert

Last Updated: 2012-04-13

Package Version: 1.0.0.0

Category: Communication

Downloaded: 1289 times

Followed by: 1 user

License: MIT license  

This is a library written for the mikroPascal compilers to interface to these devices on a single bus. The library also includes functions that allows the master device to discover the number of slave devices on the bus and read there serial numbers.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "OneWire Communication Library with Search functionality " changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "OneWire Communication Library with Search functionality " changes.

Do you want to report abuse regarding "OneWire Communication Library with Search functionality ".

  • Information
  • Comments (0)

Library Blog

OneWire Communication Library

Example

//==============================================================================
begin
  // Init the CPU
  ADPCFG := 0xFFFF;                    // Configure AN pins as digital I/O

  // Init UART1 module for debug output
  UART1_Init(9600);

  // Init the one wire library
  oneWire_Init(PortD, 10);

  // Do a search for the one wire devices
  oneWireCount := oneWire_Search(@oneWireDevices, MAXDEVICE);
  
  if (oneWireCount = 0) then
  begin
    UART1_Write_Text('No OneWire devices found');
    while true do;
  end;

  // Now all the addresses of the one wire devices will be in the
  // oneWireDevices array and oneWireCount will have the number of
  // devices on the bus
  
  // Send the temperature on all of the devices to the UART port
  while (TRUE) do
  begin
    // Start convertion on all of the devices
    oneWire_Reset();                     // Onewire reset signal
    oneWire_WriteByte(0xCC);             // Issue command SKIP_ROM
    oneWire_WriteByte(0x44);             // Issue command CONVERT_T
    Delay_ms(750);                       // Wait for conversion

    // Loop trough all of the devices
    for i := 0 to oneWireCount - 1 do
    begin
      // Read device i's temperature
      temp := DS1820_ReadTemperature(oneWireDevices[i]);
      // Show the temp on the LCD
      Display_Temperature(temp);
    end;
  end;
end.

ALSO FROM THIS AUTHOR

PIC24F ADC library with callback

0

Analog to Digital Library for the PIC24 and dsPIC range. Library supports multiple channels and has a callback function that is executed as soon as all the channels are read. The sampling frequency can also be specified in Hz

[Learn More]

DateTime utilities compatible with Delphi and Lazarus

0

This unit provides you with the functionality to work with date time variables the same way that Delphi and Lazarus handles them. The unit supports - Leap year, - Encode date-time, - Decode date-time, - Increment and decrement functions, - Period functions such as minutes between two dates

[Learn More]

PIC24F Timer modules with callback support

0

This library makes it easier to work with the build in timer modules of the PIC24F range. There are 2 units you can include in your source code. The initialisation function takes 2 parameters, the interval in milliseconds and the callback function that should be executed.

[Learn More]