What about Big Dan the Blogging Man?

First, I’ve been called Big Dan the <blank> Man for so long that I’ve begrudgingly grown used to it.

My primary interests are computers, electronics, and photography.

I’ve created this blog to share some of my various projects in some detail so that I don’t bore Facebook friends with all of the details of what I’m building.


If you ask me a question and you don’t include punctuation, don’t expect an answer. Understanding a technical question enough to answer it is difficult as it is. Don’t make it harder!

11 Responses to About

  1. Hans-Peter says:

    Hello Big dan – blogging man
    best regards from Austria – excuse my bad english – but our language is german.
    i have seen with great interest, your homepage – special your articel to “Lazarus and i2c with RPI”.
    my interest is, to learn, open close read and write on i2c-Bus with Lazarus under RPI’s GPIO.
    Please do you have a minimal sourcecode with Lazarus, that i can speek with i2c.
    i have test my rpi with LXTerminal with the command: sudo i2cdetect -y 1 and i can see my i2c-device-Adresse, but now, it would be nice, if i can this in Lazarus.
    Can you help please?
    Thanks and best regards form styria – Austria
    Hans-Peter Traussnigg

  2. hans-peter says:

    Hi Dan.
    1000 Thanks for answer. But i have questions to your “program testr2c”.

    Is this a program, how use the commandline from LXTerminal or so?
    I need to have a “visual Lazarus” form, with buttons and Label.caption to see my i2c – commands.
    Is this also going with your program? There probably need commands as: i2c start, i2cstop, i2cread and i2cwrite or so…..

    Best regards Hans-Peter

  3. Dan TheMan says:

    Hi Hans-Peter,

    If I understand your question, you want to know if I used the gui components of lazarus? No, this was a simple lazarus console program, but it should work from the GUI interface too. The nice thing about how this is implemented is you are using standard library calls (fpopen, etc). Nothing tricky at the application level.

    Here is some commentary for the program:

    handle := fpopen(devPath,O_RDWR); – This opens the I2C device for read/write. devPath contains ‘/dev/i2c-1’. You may want to verify that is the correct path for you too.

    fpIOCtl(handle, I2C_SLAVE, pointer(iDevAddr)); – this indicates the opened file handle is going to be an I2C_SLAVE device and the address is iDevAddr ($68). You can get that with your i2cdetect command.

    fpwrite(handle, buf, 1); – fpwrite is how you send data to the I2C device. Here I send just the first byte of .

    fpread(handle, buf, 7); – fpread is how you receive data. Here I retrieve 7 bytes.

  4. hans-peter says:

    Dear Dan
    I have great interest to find a solution by your proposal in Lazarus.
    Still it does not work with connect the I2C interface.
    It comes after the first compilation of Note:
    Hint: conversion in between odrinals and pointers is not portable!

    Then some error messages come.

    The most important thing for me and my anderstand:
    What is I2C_Slave = 1795; — why 1795 – is this realy the I2C-Device-Adress?
    and what is : iDevAddr: cint = $04 – is this also a I2C- Device-Adress ?
    What is true??

    handle: cint ??? what can i anderstand under “cint” ???

    Please re-politely for assistance.

    Thank you very very much!
    Best regards

  5. Dan TheMan says:

    I2C_SLAVE is a constant that tells ioctl that the file opened is actually a slave I2C device. Here is some useful info http://stackoverflow.com/questions/9974592/i2c-slave-ioctl-purpose.

    iDevAddr is going to be the actual I2C address for your device. That is the address you will see in i2cdetect.

    CInt is simply a 32 bit integer. It is defined here: http://www.freepascal.org/docs-html/rtl/ctypes/cint.html.

    I’m not sure why you would be getting a conversion error. I’d have to see the code and data defs to even take a guess.

  6. Mike Xeno says:

    Just wanted to thank you for the ky-040 rotary write up you did. It was very helpful.


  7. Amol P says:

    I like your electronics blog…very useful stuff. cheers!

  8. Attila says:

    Hello Dan.I’m from Turkey.I have a question about “SIM800L”
    Is there a any problems occurs about IMEI registeration of “SIM800L GPRS” modul? I have a SIM800L but when I power on my modul I will just use it within country for 2 months.After 2 months it will be closed.

    Can I change the IMEI number of modul via FTDI connection. I want to use it my bike alarm project. Thanks.

    • Dan TheMan says:

      The IMEI # is permanently assigned to the chip. I’m not aware of any way to change it. It just uniquely identifies the 800L device/phone to the wireless provider.

      As I recall, you just need to provide the EMEI when you register a new SIM card.

      Once your project is done and the SIM card ‘expires’, the next time you want to use the 800L, you just register a new SIM card (some times you can reuse the old card).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s