how to get around an absent driver

disclaimer:
i'm out of my depth. as such any statement maybe ( and most likely is ) on the border of being very stupid. As such = my apologies.

Lets say i have a device (some sensor) that doesnt' come with arduino specific driver. What are my options at this point?

Can (and HOW) i use the arduino board and still access the device using manufacturer's supplied driver?

You need to look at its datasheet.... a device sends and receives a specific pattern of LOW voltages and HIGH voltages, and it interprets them as data.

So, an arduino's LOW voltage is 0, and its HIGH voltage is 5v in most cases.

The device might be difference, so you need to know that first. If its 0 to 3.3v for instance, you'll need a voltage divider of some sort to lower the voltage....

Then you need to know the pattern, and timing of the pattern, and create a sketch that will write out the pattern/interpret the pattern for communication.

There are no "drivers" for sensors to interact with Arduino. Arduino is just a chip with some pins. Those pins can either read a voltage or output a voltage. When and with what timing is all about the code on the board. First Google and see if anyone else has written code for this mystery sensor. If not, then you'll have to look over the datasheet and study up on whatever sort of communication it may use and write your own code to interface with it. The manufacturer may have some code for it, and if you can understand that code well enough to port it over to Arduino then you're in luck. But the concept of a "driver" is not really applicable here.

If you want our help with that then you should probably divulge some details instead of just calling it "some sensor".

Delta_G:
... The manufacturer may have some code for it, and if you can understand that code well enough to port it over to Arduino then you're in luck. But the concept of a "driver" is not really applicable here.

If you want our help with that then you should probably divulge some details instead of just calling it "some sensor".

Thank you this is a perfect answer.
So if there is a manufacter's driver why do i have to port it to Arduino? The manufacturer already created the API in C code... how can i "just use it"?

AZZ:
Thank you this is a perfect answer.
So if there is a manufacter's driver why do i have to port it to Arduino? The manufacturer already created the API in C code... how can i "just use it"?

You haven't said what sensor nor have you shown the code in question. How the hell would anyone here know if it can run on an Arduino? If it's c code but it's written for a PC (which your continued use of the word driver implies) then chances are it isn't compatible with Arduino.

.. You haven't said what sensor nor have you shown the code in question. How the hell would anyone here know if it can run on an Arduino?

I understand. But i think it is more of the general conceptual question, than the specific "use case" .
and let me drop the "driver" and start using more appropriate word "library". thank you for pointing out.

This is my current understanding:
a. If thee is a rather simple sensor and i do not have an arduino library/driver - i should dig into the sensor's datasheet and figure out what power level constiture high/low and how that can be communicated to /from the sensor

b. in case i have a more complicated sensor/device and manufactor created an C based API - i can either wait/develop an arduino specific library or ??

AZZ:
I understand. But i think it is more of the general conceptual question then the specific "use case" .

Think what you want, but without specifics nobody here can help you use this mystery sensor. The answer to this question differs depending on what sensor we're talking about and what code you have for it and what that code looks like and what it does and how it is written.

AZZ:
and manufactor created an C based API

A C based API for what processor? It matters. You can't use this API on Arduino if it was written for a PC.

Delta_G:
A C based API for what processor? It matters. You can't use this API on Arduino if it was written for a PC.

Ok. ok. i gave up.

Here is the link to the DW1000 sensor.

there is an arduino opensource project that uses it.

So i still try to understand why i can't "just" run the code from the examples in arduino.

AZZ:
So i still try to understnad why i can't "just" run the code from the examples in arduino.

If it was written for an Arduino then you certainly can. But an Arduino has one set of hardware. A PC has another set of hardware. Trying to use a driver written for a PC on an Arduino would be a lot like following the instructions for a piece of IKEA furniture to put together a bicycle.

Really dude? I just googled "DW1000 Arduino" and the very first hit was to a github page with a library for using it on Arduino. Did you not try that?

Delta_G:
Really dude? I just googled "DW1000 Arduino" and the very first hit was to a github page with a library for using it on Arduino. Did you not try that?

hmmm. so the examples are for the use with PC not arduino/pic/etc?

yes, i'm well aware that there is an open source project, which i did mentioned in 1 post above.

AZZ:
hmmm. so the examples are for the use with PC not arduino/pic/etc?

Don't know, just giving you an example of why you can't run just any old C code on an Arduino.

AZZ:
yes, i'm well aware that there is an open source project, which i did mentioned in 1 post above.

So why not use that code, or build from that code?

Delta_G:
Don't know, just giving you an example of why you can't run just any old C code on an Arduino.

So why not use that code, or build from that code?

I think the right question i should be asking is "how to port the code to arduino".

AZZ:
I think the right question i should be asking is "how to port the code to arduino".

Well you've, made it clear from your comments that you know a lot more than me about what is relevant or important. If that's true then you should have no problem porting this.

The OP question in general was not that far off the subject.

One of the features of this forum, not everything needs to be in code and "why would you do that for?" style.

To my recollection "driver" term was originally used to describe a software interface between the OS and I/O devices.
The idea was to let the driver do the dirty work of converting generic "high level" function to hardware operation.
Generic "printf" function driver for brand X was different than driver for brand Y.
Unfortunately Arduino invented this "library" term so instead of driver for Hitachi LCD or driver for ILI9341 LCD we now have "libraries" for each.

BTW Github is great resource.

Jim

Delta_G:
Well you've, made it clear from your comments that you know a lot more than me about what is relevant or important. If that's true then you should have no problem porting this.

i'm not sure i follow.

You mention an 'arduino opensource project'; please provide a link. So with that project, there should not be a need to port.

Did you try the examples; what was the result? If it did not work, please show your code using code tags and tell us how it failed.

There's no need "to get around an absent driver", or for porting code from one language/platform to another.

You mentioned that you found the Arduino library for the Decawave DW1000 chip/module.
Simply download the library and install it, study the examples provided with the library, then write your code based on those examples. If you strike problems, come back and ask for assistance.
'arduino-dw1000' Library

Edit: Pretty much what sterretje said. I got called away for a bit, saw his reply when I went to post, but thought I'd still post anyway since I had a link to the library. :slight_smile:
(Sorry for stepping on your toes, sterretje. :frowning: )

You missed them by miles :smiley: I was just not in the mood to try to find the library.

I have that same problem, by the way. Wife or dogs call while I'm typing, don't want the energy to go to waste and post anyway when I get back (it will just emphasize what was said before :wink: ).