finding registers of sensors

Sparkfun has breakouts for numerous sensors. They have information for using
Arduino, but I want to use Picaxe. How can I get info on initializing sensors and
specifications on registers that can be accessed via I2C. Also, how can I get source code
for INCLUDE statements in C++ code?
 

Rick100

Senior Member
Sparkfun has breakouts for numerous sensors. They have information for using
Arduino, but I want to use Picaxe. How can I get info on initializing sensors and
specifications on registers that can be accessed via I2C.
You will have to download the datasheet. Sparkfun should have links for anything they're selling. You can also use Google to try and find examples and tutorials.

Also, how can I get source code
for INCLUDE statements in C++ code?
Download the Arduino library and unzip it. Then use a text editor to look through the files. The program files will have extensions like .h .ino and .cpp . The information may be spread out over many files. It's not easy or fun.

Good luck,
Rick
 

premelec

Senior Member
Probably not much help C++ for PICAXE guys :) When do we get a translator program that turns C++ into PICAXE BASIC?
 

techElder

Well-known member
Probably get a lot of "things" after that ... 8GHz ... PICAXE processor comes out with oodles of RAM and EEPROM!
 

Goeytex

Senior Member
Sparkfun has breakouts for numerous sensors. They have information for using Arduino, but I want to use Picaxe.

Sparkfun caters mostly to Arduino enthusiasts in regards to code examples as it is by far the most popular hobbyist platform worldwide. Unfortunately, in many cases this leaves those of us who choose to use other capable platforms such as Picaxe with only Arduino code examples.​

How can I get info on initializing sensors and specifications on registers that can be accessed via I2C.
As has been stated by Rick, this information is available in the Datasheets for the particular devices being considered. These Datasheets should be available through either SparkFun or from the device manufacturer. If not available though Sparkfun, I typically use Google (or another search engine if you choose) to find and download the datasheets in question.​

Also, how can I get source code for INCLUDE statements in C++ code?
I assume you mean the Arduino source code from the include statements found in the main Arduino example "sketches" (AKA "Programs". This code is tracked down by searching for the particular include file, either in the local Arduino folders or on the internet if required.

Without a working knowledge of Arduino's "C" it will be difficult to port the code in to Picaxe Basic. There isi no converter program that I am aware of that can convert Arduino C into Picaxe Basic. Also consider that Arduino "C" supports floating point math and signed "long" variables, while Picaxe Basic does not, other challenges to use Picaxe Basic in place of Arduino C are presented to the Picaxe Programmer.

Suffice it to say that what you are wanting to do is extremely difficult but not impossible. It depends upon the actual application, your particular skill set, aptitude, and willingness to learn. Have proper test equipment such as a decent scope and a Logic Analyzer (Saleae ,etc) can be indispensable, if not required, depending upon the application(s).

Your post specifically mentioned sensors and I2C. This should be doable with Picaxe Basic WITHOUT having to refer Arduino C / Sparkfun examples. The Datasheet for the particular sensor should provide enough information to allow writing the Picaxe Basic Code. However, referring to example Arduino code can be helpful at times if you have a general understanding of the C language. I suggest getting a copy of Notepad++ or another advanced Editor View and search the Arduino Files.

My suggestion is ... if you want help with Picaxe Basic for a particular sensor, is to let us know what sensor you are interested in working with and provide a link to the product's datasheet. It may be that someone has already written working Code for that sensor.​

Good Luck​
 
Goeytex and all u other guys. An update on my search for info. Before this I had been looking at a data sheet for T5400. I thought this wud cover T5403. It may hav been a prelim document and did not have the REGISTERS. But then I found the data sheet for T5403 which thoroughly covers the REGISTER addresses, etc. I successfully retrieved info from at least one reg. So I hav work ahead. I tried retrieving RAW pressure data and TEMP data but the sensor balked maybe because had not yet filled in the CALIBRATION registers. Again thnx 4 the help.!
 
Top