Basic Stamp II - Code for displaying on LCD
Passerby
Posts: 17
Hi fellow programmers.
I'm having my FYP at my school atm, and I'm totally new to Basic Stamp programming codes, so I'm here seeking for help.
My current assignment scenerio is this:
·+5V········ ····x···· +5V
·· |·············· x·······|
·· |·············· x· ···· |
·Infrared······· x···· Narrow Acceptance
· LED(GL480)··x·····High Sensitivity Phototransistor (PT481/PT481F/P483F1)
·· |············· ·x·······|
·· |·············· x······ |
·GND············ x·····GND
The x is a board tat is·used to block the infrared from the phototransistor. This is the value I get when blocking / unblocking the infrared LED from the phototransistor:
Unblocked: 3.4V
Blocked: 0.2V
Our assignment is for us to write a program that will display a message on the LCD whenever the board is being remove, unblocking the infrared LED from the phototransistor.
I would appreciate any help that is given here by any fellow programmers. Thanks!
Post Edited (Passerby) : 11/11/2008 2:58:16 AM GMT
I'm having my FYP at my school atm, and I'm totally new to Basic Stamp programming codes, so I'm here seeking for help.
My current assignment scenerio is this:
·+5V········ ····x···· +5V
·· |·············· x·······|
·· |·············· x· ···· |
·Infrared······· x···· Narrow Acceptance
· LED(GL480)··x·····High Sensitivity Phototransistor (PT481/PT481F/P483F1)
·· |············· ·x·······|
·· |·············· x······ |
·GND············ x·····GND
The x is a board tat is·used to block the infrared from the phototransistor. This is the value I get when blocking / unblocking the infrared LED from the phototransistor:
Unblocked: 3.4V
Blocked: 0.2V
Our assignment is for us to write a program that will display a message on the LCD whenever the board is being remove, unblocking the infrared LED from the phototransistor.
I would appreciate any help that is given here by any fellow programmers. Thanks!
Post Edited (Passerby) : 11/11/2008 2:58:16 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
1. Hardware connections for the Led and Phototransistor
2. Programming to monitor the state of the input from that hardware.
3. Programming to display results to the LCD hardware.
What is it you need help with?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
For the hardware connections, I can figure it out on my own with the help of datasheets, so I guess I'll skip that option.
For Programming to monitor the state of the input from the hardware, yeah I need help on where I can start off with.
For Programming to display the results to the LCD hardware, that I should have no problem working it out, but if I do have a problem I'll wish and hope that you guys would help me out. [noparse]:D[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
I did it with the debug screen to test if the result is correct. I connect my Vss to Pin0, and run the program, but the input is always displayed as 0. Did I do something wrong? Or is it my connection
Post Edited (Passerby) : 11/19/2008 3:59:32 AM GMT
Vss / Vdd
<[noparse][[/noparse]10k resistor]>
Pin 0?
Now for the circuit. My current draft circuit is like this:
Vcc········ · ·Vcc
|········· ······ |
|········ ·· ··· ·|
|········· ······ |
LED······ ·Phototransistor
|········· ······ |
|············ ··· |················ |
Resistor···· Resistor··········|
|················· |··············· |
|··················|··············· |
GND··········· GND··········· Pin 0
With the above code, the reading is still incorrect. Its always 1.
Post Edited (Passerby) : 11/19/2008 7:15:51 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
edited:· actually your IR LED·isn't hooked up wrong if you are driving it continuously without the microcontroller, but the diagram should help you when you hook up to the Stamp.
Post Edited (Mikerocontroller) : 11/20/2008 8:39:33 PM GMT