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!

Google It!

I don’t get a ton of questions so I try to answer those I do. Some times I’m surprised at the questions that I’m asked because I find the answer immediately upon googling it (yeah, I rarely know the answer to questions I’m asked either).

Coming from the pre-internet days, Google is such an amazing tool, I cannot imagine life without it. And it seems very odd to think of never knowing life before it. It used to be when you had a problem, you read the manuals, the couple of books you might have, and ask coworkers. More often than not you had to work the solution out yourself and it would take entirely too much time.

Take advantage of this amazing tool! I very rarely post questions on any forum. Not because I don’t have a ton of them, because I do. But almost every question I can think of, someone has answered on Google, you just have to track it down, and typically that is way faster than waiting for a forum answer.

37 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).

  9. rieumailhol says:

    Chapeau bas, messieurs, un génie !
    Quels talents !

    Merci Dan pour le partage de vos sérieuses expériences …

  10. Eyram says:

    I’m on a GPS tracking project with 3 functions.

    1. Getting GPS cordinates
    2. Posting GPS cordinates
    3. Turning a relay switch (engine control) on or off and additionally get the GPS coordinates when sms commands are sent.

    The first 2 functions work in the loop function but the 3rd doesn’t work. The 3rd function is totally ignored. I feel it’s a buffer overflow. I’m not very experienced with Arduino and I’ll like you to assist me.

  11. samy says:

    Dear Dan

    I used you sample code below to test Ds18b20 temperature sensor using Feather adafruit huzzah esp8266 with GPIO pin 12 and corresponding lua pin of 6 .However,I am getting temperature reading of 85 c which is not accurate reading.
    hence, could you suggest me any thing ,please?

    Yours faithfully,

    count = 0
    count = count + 1
    addr = ow.reset_search(pin)
    addr = ow.search(pin)
    until((addr ~= nil) or (count > 100))
    if (addr == nil) then
    print(“No more addresses.”)
    crc = ow.crc8(string.sub(addr,1,7))
    if (crc == addr:byte(8)) then
    if ((addr:byte(1) == 0x10) or (addr:byte(1) == 0x28)) then
    print(“Device is a DS18S20 family device.”)
    ow.select(pin, addr)
    ow.write(pin, 0x44, 1)
    present = ow.reset(pin)
    ow.select(pin, addr)
    data = nil
    data = string.char(ow.read(pin))
    for i = 1, 8 do
    data = data .. string.char(ow.read(pin))
    data:byte(1),data:byte(2),data:byte(3), data:byte(4),
    data:byte(5),data:byte(6), data:byte(7),data:byte(8))
    crc = ow.crc8(string.sub(data,1,8))
    s=string.format(“CRC: %02X”, crc)
    if (crc == data:byte(9)) then
    t = (data:byte(1) + data:byte(2) * 256) * 625
    t1 = t / 10000
    t2 = t % 10000
    print(“Temperature= “..t1..”.”..t2..” Centigrade”)
    until false
    print(“Device family is not recognized.”)
    print(“CRC is not valid!”)

    • Dan TheMan says:

      Per http://forum.arduino.cc/index.php?topic=201863.0 “There is a footnote on page 4 which says “The power-on reset value of the temperature register is +85°C.”
      so if you read 85 degrees it means it hasn’t done a conversion since the last power on.
      You hadn’t wired it up properly so the sensor was being powered off and on periodically, which resets the register to 85 and that is why you got a valid CRC from it.”

      So 85C indicates there is a problem w/ the sensor. I don’t know what that problem may be off hand, but look at the above thread and look for other guys w/
      the same issue and hopefully you can figure it out.

  12. Neil says:

    Hi Dan

    We really like this blog and want to feature it on our website. If you are interested, kindly drop me a message on my e-mail: nmulaaccess@gmail.com. I’ll be looking forward to your response! Thanks.

  13. Neil says:

    You may check, EETech Media at http://www.eetech.com and its tech community sites. Send me an email so I can provide you more details related to it. Thanks. -Neil

  14. Pingback: Warp: Playing Offline | Renga in Blue

  15. Jon Arbuckle says:

    Hello Dan I was wondering for the simH pdp-8 emu page, where would I find and download the rk0.dsk file?

  16. Jon Arbuckle says:

    I have the kermit file but i don’t have the rk0.dsk that is what I’m asking about.

  17. Jon Arbuckle says:

    What other hard drive image file do I need other than kermit?

  18. Jon Arbuckle says:

    I can’t open the dsk file. I’ve used many dsk opening software but none of them work. Any suggestions?

  19. Hello Dan,
    I was very happy to find the HP3000 emulator here as I was looking to run Warp via telnet as I used to do, but that seems to be down at the moment (empire.openmpe.com) or maybe permanently? I used to play Warp on our HP3000 back in the day….

    I was wondering whether you would know whether there is an emulator for Mac somewhere, too? I looked but did not see. I can run Windows through Parallels on my Mac and the HP3000 emulator works just fine, but I have students who might like to try this, who don’t have Parallels….

    Thanks very much!


  20. MAP says:

    Hi Dan,
    Thanks so much for your posts. They are very useful and inspirational.
    I discovered your nice piece of code to calculate sunset and sunrise using pascal. I love it because is small, simple and direct… and I works like a charm!

    Morever of sunset and sunrise calculations in different scenarios (astronomical, nautical, civil and official), I am also interested on calculate the solar noon time, as well as the sun position at that moment. I readed that the solar noon time as well as sun position is already included in the calculations of the sunrise and sunset. I found some equations but i do not see a correlation with your code. May be because yu use deg instead of radian unit.
    Could you help me to extract those values using your code? I really appreciate it, and i am sure many other could found it interesting as well.

    Best whishes,

    • Dan TheMan says:

      I took a quick look at this, MAP. Solar noon would have a zenith of 0 degrees (whereas Official is 90.8333 degrees). I think if you were to create another setting of zenithNoon with a value of 0, then it would make the correct calculation for you. Mind you, I haven’t tried it myself, but it seems like it would work.

      • MAP says:

        Thanks so much for your quick reply and the tip to head me to the solution.

        However it seems not be that simple… because returns errors. Other changes seems be required when applying other of the equations and corrections of angles, quadrants,.. or in the calculation of the noon time using other equations as appear here: https://gml.noaa.gov/grad/solcalc/solareqns.PDF
        In any case, thanks so much for your time and reply. I really appreciate your help.

  21. Harvey says:

    Hi Dan,

    First of all, sorry for my bad English. It’s not my main language.

    I have some COBOL programs, connect to Oracle DB. I’m trying to make a change in DB from Oracle to Postgres so I’m trying to use ocesql. (Your blog posts really help me a lot about how to use that. Thank you very much!)

    The problem is, I have a program using DECLARE CURSOR WITH HOLD and it is not supported by ocesql. I tried to delete the WITH HOLD but It shows some errors about transaction. Do you have any experience on this or can you guide me to walk through this problem?

    Again, thank you very much for your posts!

    • Dan TheMan says:

      This isn’t something I have experience with. My only suggestion, since ocesql doesn’t support HOLD, would be to figure out how to do the query without the hold.

      PS, your English is great!

  22. John Friel says:

    Dan, thank you for your write-up on getting the HP2000 SIMH running. I started my programming journey in high school on a Decwriter II connected to the local college HP2000 system. Now, I’ve got a restored Decwriter and am looking forward to getting that HP2000 running. Yahoo Groups is no longer, and I’ve scoured the web looking for that “clean access.zip” file, but all the links are dead. Do you by chance still have a copy of this?

    Thank you in advance.

    John “Qmodem” Friel
    (yeah, I wrote that way back when…)

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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.