Adding tsl230_pi object to a modified SensirionDemo spin file
djt
Posts: 19
I have modified the SensirionDemo (Attachment #1)·spin file to collect and output·data using the FullDuplexSerial (Attachment #3)spin file in the format fashion I want. The program·compiles, runs and outputs the data·as I want it to.·Now I want to add a light output reading from·the tsl230_pi spin file (Attachment #2). I have run the tsl230_pi_Demo file successfully (so my board is connected properly and the tsl230 sensor is working), but I·have not been successful in getting·the tsl230_pi file to run in the modified SensirionDemo file.
Any help in this area would be greatly appreciated.
Thank's,· djt
Any help in this area would be greatly appreciated.
Thank's,· djt
Comments
I would like to see your fist TRY how to add the tsl230 code to it
Did you examine the file tsl230_pi_DEMO.spin how it is done there ?
post another SPECIFIC question here to get help
best regards
Stefan
Attached is·a copy of my SemsirionDemoLight spin file with the attempt to incorporate the tsl230_pi object. As mentioned previously·without incorporating the tsl230_pi object the·program runs and supplies the correct output---Temperature, relative humidity and dew point. When I run the attached file the output is ***.* and 0.0 for all the various variables.··Obviously, I don't know how to input an object (tsl230_pi)from another file into a new file(SensirionDemoLight).
The SH11 sensor is connected to propeller pins 1 and 2. The tsl230 sensor is connected to propeller pins 3 and 4. The program SensirionDemo (as I interpert it) indicates the SH11 sensor data pin and clock pin are connected to the propeller pins 0 and 1 respectively.·I know the propeller pins begin at 1 not 0. What am I missing?
Thank's for your help.
djt
Also, just to be clear, the TSL230 requires 3 connections to the propeller if you want to run it in "auto" mode: inpun, ctrlPinBase, and ctrlPinBase+1. That third pin HAS to be next to ctrlPinBase. In your demo code, this would be Propeller pin 5.
I'm not sure I understand what you mean by "I know the Propeller pins begin at 1 not 0." The prop pins are labeled 0-31.
Hope this helps.
I will add the lines you indicated and·try again.
Thank's again,
djt
I still have a problem I don't recognize.·With both of the sensors running the output from the SH11 is like this ***.*% and soforth.All elements output but only ***.*.The tsl230 output is normal.I have attached the updated SensirionDemoLight spin file so that you can view the modifications.·I've reviewed the board wiring and can find no problems. There is interference from somewhere---the board/program??I've reviewed the program and when I eliminate the line "light.start(inpin,ctrlpinbase,samplefreq,autoscale)", the SH11 output is correct, but get no·output from the tsl230.
Any suggestions· from any one would be greatly appreciated. Remember, I'm·new to the spin language.
Thank's,·djt
I don't have a sensirion temp/humidity sensor, but I do happen to have a TSL230 hooked up on my prop demo board at the moment. If I load your program and run it on my demo board (leaving the sensirion pins 0 & 1 unconnected), I get the following:
So your code seems to be working; I get a return value for everything even though the temperature and humidity readings are obviously bogus. Is it possible that it's some kind of problem with the floating point number format you've specified for the output? Might be worth playing around with the format a bit just to be sure that isn't it.
I've attached the code I used to test this...you might want to check to be sure I'm using the same thing that you've got. I went out to the obex to get the sensirion driver object, I presume it is the same one you're using. FYI, the propeller tool has an option under file/archive/project that will kick out a zip file with all required objects needed for someone else to run your code. The archive feature is the best way to make sure we're looking at exactly the same code and can replicate exactly the same behavior you're seeing.
· Thank's····· djt
I've been looking at the sensirion and tsl230 objects and so far I don't see anything obvious that would cause the problem you describe.
Thank's, djt
I tested your code with no sensors connected.
if you take a look into the file floatstring.spin
you can see that "***" means format error
So I increased the digits from 5 to 7 and then values are displayed.
With no sensors connected the values are Smile of course.
So I suggest increase the digits from 5 to 7
To get the PST.EXE output to a posting you do it like always:
mark the desired area with the left mouse button hold down and do a copy&paste
that you get real digits displayed and then narrow down why the values have such a great range
This might be a hardware related problem and this would explain why you get this error without having changed the code
best regards
Stefan
Thank you for your excellent info. I now have the program (See attachment)running and out-putting the data I want and in the format I need. The next stages are to add an LCD for local display, a data logger and a hi-lo temperature measurement. I'm sure I'll be back with more questions from the experts.
Thank's··· djt
You're welcome. Here's a "get you started" for the LCD:
http://www.parallax.com/tabid/781/Default.aspx
The September 2009 column is about LCDs. Also, there's several LCD drivers in the Display OBEX.
Good luck.