Shop OBEX P1 Docs P2 Docs Learn Events
Sensirion — Parallax Forums

Sensirion

Shining IvyShining Ivy Posts: 5
edited 2010-02-25 22:19 in Accessories
Hello I am new to the world of microcontrollers and this is my first posting on the forums. I am trying to make a environmental control system using the propeller chip, sensirion sensor, and a modified SensirionDemo to monitor then toggle an I/O pin to flip a relay, but I can't seen to understand the code that holds the value of humidity (or temp for that matter). I was thinking that if i declared a global variable and ran another cog to monitor that variable I could then have an "if" statement read the value and act accordingly, but apparently I don't know what I am doing. I have modified the display driver to work with the FullDuplexSerial because I dont have a TV. The code is attached. Any help would be very great.
Thanks

P.S. I have worked my way through the PE kit Lab and I am going back through it because obviously I need to.

Comments

  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2010-02-25 01:21
    The Sensirion object works very nicely, but in my opinion is not a true "demo" because it lacks the details to explain how to use the object exactly how you mention. This Thread I started back in August stems from the frustration I had when trying to figure out what the code is doing in the Sensirion object so that i could do more with it. What I ended up doing was stepping through every word of the code and tracing what was going on in each object. For example:


    rawTemp := f.FFloat(sht.readTemperature)
    


    Has nothing for a comment. However, here's my note for this line of code:
    rawTemp equals the value returned by the readTemperature routine in the SHT (sensirion.spin) object after being formatted by the FFloat routine in the f (Float32.spin) object

    That's really long winded for a comment, but that's my note I created after I analyzed that single line of code over and over again. Even though I have a few propeller projects on my completed list already, I haven't finished the PE kit. You should be able to do exactly what you are asking about and I would suggest doing what I did with the Sensirion code and then find a PE Kit lesson that digs deeper into sharing variables between methods/cogs. I think the Result variable explanation, page 74,may be a start. Once you have each of those down, just join them together. (This is how I have completed projects; I can mash up demo programs very well to make "my" desired program).

    also, look here: http://forums.parallax.com/showthread.php?p=574524 Example 5 on the first page.

    I am sure some seasoned "SPIN"ners will have more to say (and maybe even correct me)

    Welcome to the forums!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010
  • FranklinFranklin Posts: 4,747
    edited 2010-02-25 22:19
    If you have questions with the Propeller and spin you probably will get better, faster answers in the propeller forum. If you have questions on the sht11 you would post here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.