Shop OBEX P1 Docs P2 Docs Learn Events
Help, I'm failing high school microrobotics. How do you do a program not conne — Parallax Forums

Help, I'm failing high school microrobotics. How do you do a program not conne

corybcoryb Posts: 3
edited 2008-12-08 01:37 in BASIC Stamp
I am a 10th grader failing my microbotics class.· We're doing a unit on sensirion sensors.· I am supposed to design a display and develop a program that will indicate the exact temperature or humidity when the BOE is not connected.· He gave us the below before telling us to do this.· I don't even know where to start.· Please help, thank you.
·' Main Program Code
'

Do
GOSUB SHT_Measure_Temp
GOSUB SHT_Measure_Humidity
DEBUG CLS
DEBUG “Temp=“, DEC (tF/10), · Degrees”, CR
DEBUG “ Humidity=“, Dec· (rhTrue/10), ·· “,CR
PAUSE 1000············· ' minimum delay between readings
Loop
·END
·When modifying this program, you should only change or remove this Basic code.
Keep the lines shown here in yellow.
·
You may add Basic programming code (as needed) in this area.
Remember:
tC = temperature in Celsius
tF = temperature in Fahrenheit
rhLin = humidity; linear zed
rhTrue = humidity; temp compensated
Divide variables above by 10

·

Comments

  • Carl HayesCarl Hayes Posts: 841
    edited 2008-12-05 03:38
    You have to have the Stamp (or machine containing a Stamp) connected to the PC when downloading the program to the Stamp. That's the only time you need the Stamp connected to the PC.

    You can work on the program (edit it, check the syntax, save it to hard disk, etc.) without the connection. Then you just work on the PC, without the Stamp.

    You can run the Stamp without the PC after you have downloaded the program from the PC to the Stamp. Download the program to the Stamp (that is, load the program into the Stamp) from the PC, then you can disconnect the PC and run the Stamp program without the PC connected. The Stamp will remember the program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • MSDTechMSDTech Posts: 342
    edited 2008-12-05 03:44
    I would suggest you read the chapter in the basic stamp manual on serial communications. Then do a search on the Parallax web site for serial displays.
  • FranklinFranklin Posts: 4,747
    edited 2008-12-05 03:50
    You really should do your own homework. If you don't understand some part of the code or how to program you need to ask your teacher, that is what he is there to do for you. It looks like you need to write two subroutines and there is info if you go to the sht11 product page on parallax site.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2008-12-05 04:27
    Cory,

    Since nobody is handing over the answers as easily as you expect, show us some effort and progress first. Then, come back with a succint, focused question about a single piece of the problem. These guys are going to be more helpful if they see you helping yourself. Don't assume we won't help, because we will, but only after we see some effort.

    I'll give you one small tip to get started. He's mostly giving you a cut and paste task. There's a danger in this, though. If you don't understand each line of code that you cut and paste you won't be able to solve the problem. Microcontroller projects don't work until you make them work. You can have errors in wiring, software, or concept. Do it one small step at a time.

    Ken Gracey

    Post Edited (Ken Gracey (Parallax)) : 12/5/2008 5:20:50 AM GMT
  • SRLMSRLM Posts: 5,045
    edited 2008-12-05 05:35
    I assume that you're going to use an LCD to display the data when not connected (since the debug code is in black). So, you can do it first and get it working with the debug statements while attached to the computer, then you can move on to displaying the data on the LCD. By breaking it up into pieces, you can generally find errors more easily.
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-12-05 11:58
    Parallax sells LCD screens, and they provide documentation on how to use them. If you dig around on their website you'll find everything you need pretty quickly:

    www.parallax.com

    That's how I learned it. It's a good way to learn a LOT of other things about these devices too.
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-12-05 13:49
    Probably your teacher meant "When the PC is not connected". Or maybe "When the BOE is not connected to the PC" -- so you'll need some LCD display code.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-12-05 20:34
    coryb

    I hope You picked a good "Alias" or User name.I'd bet money Your teacher looks to this forum for ideas ;Every day.

    Once You have focus and direction,send a post reply! "LCD ,VFD, LED7seg. etc.".What· kind of display

    _____________$WMc%____

    Post Edited ($WMc%) : 12/5/2008 8:41:24 PM GMT
  • GeorgeLGeorgeL Posts: 131
    edited 2008-12-06 06:57
    LOL good point, I might be your teacher...im going to fail you. JK but How are you failing the class? Also they have example code for the temp sensors that you can piece together with an LCD and there you go, easy A
  • corybcoryb Posts: 3
    edited 2008-12-08 01:21
    Thank you.· We haven't used LCD's yet.· My thought is to add two led's and have them blink for whatever the temperature is.· The first one would be for the tens and i would add code that said if tF =>10 or =< 19 then high 14 and do the same thing up to 99 with a count variable and loop.· Then I was hoping I could say if tF =>10 or =<19 minus 10 then hi 13 and count and loop for the single digits.·if the temp is 65 i'm·hoping that the first lite will blink 6 times and the second five times and i'll have to write in some kind of pause in between each reading.
  • SRLMSRLM Posts: 5,045
    edited 2008-12-08 01:37
    I made a simple art piece that used a piezo speaker (doubled by an LED to provide audio/visuals) that counted out any number between 0 and 65,000. Basically, you output the value of the number in each position given by some variable value. For example, the number 1358 would be output by the following staccato sounds:


    1 high pitch
    3 slightly lower
    5 lower
    8 low pitches


    The listener can then infer the value by listening and counting the number of times each tone appeared, then shoving it to the left when a new lower number appeared. As an added benefit, nobody figured out the system until I told them, but then they instantly grasped the concept.
Sign In or Register to comment.