New at working with Parallax code
Hi, i'm doing an internship at a company and I need help understanding the code for the BS2sx. I have done programming before, but in C. So I understand some of it, but not enough to do what I need to do.
I have been trying out demo codes for the BS2sx stamp.
I have gotten the sensor and LCD to work separately with demo codes.
I'm using
NX1000 (stamp works experiment board)
Bs2sx
Sensirion temperature and humidity sensor (SHT11)
and a 2x16 LCD screen
I used this code for the sensor from this link
http://www.emesystems.com/BS2math1.htm
and
this link for the LCD (BS2)
http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/lcd2x16par.pdf
I have to display temperature and humidity onto an 2 x 16 LCD I have
and
I have no idea on how to do it, I have tried to find something to help me.
is there any content that can help me learn and understand the code?
(Later I need to make alarm with an LED and change the set point the alarm with push buttons. I also need to use multiple sensors (any pointers on how to do addressing of sensors to collect multiple points of measurement.)
any help would very useful. :thumb:
I have been trying out demo codes for the BS2sx stamp.
I have gotten the sensor and LCD to work separately with demo codes.
I'm using
NX1000 (stamp works experiment board)
Bs2sx
Sensirion temperature and humidity sensor (SHT11)
and a 2x16 LCD screen
I used this code for the sensor from this link
http://www.emesystems.com/BS2math1.htm
and
this link for the LCD (BS2)
http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/lcd2x16par.pdf
I have to display temperature and humidity onto an 2 x 16 LCD I have
and
I have no idea on how to do it, I have tried to find something to help me.
is there any content that can help me learn and understand the code?
(Later I need to make alarm with an LED and change the set point the alarm with push buttons. I also need to use multiple sensors (any pointers on how to do addressing of sensors to collect multiple points of measurement.)
any help would very useful. :thumb:
Comments
Work on understanding each piece of your project separately, then put them together.
For examples that show using the 2x16 Serial LCD to display sensor output, see Smart Sensors & Applications. It is discontinued but you can still download the PDF from here for the time being:
Keep in mind that these books are written for the BS2. The BS2sx is a more capable microcontroller, and there are going to be additional commands available, and different units used in the arguments for each time-sensitive command. A summary of the time-sensitive commands, and tips for adjusting code examples from one model to another, are available in the BASIC Stamp Editor Help's PBASIC Language Reference. The article is called "Adapt BS2 Code to Other Models"
I wish you the best with your internship!
I almost have it working to display temperature and humidity, I'm just not able to figure out how to send my data to the LCD
1. Have you been able to display temperature and humidity data from the Sensirion in the BASIC Stamp Editor's Debug Terminal?
2. Have you been able to display anything at all on the LCD?
If you can first verify those two are working okay independently, it will be much simpler to figure out why there are not working together.
Yes I have, I'm going to look into what mike posted.
How do you set up the program to display the Celsius variable (tC which I believe has the temperature in Celsius)
I'm using the B2sx LCD program from the previus link at the top
&
this is the link to the temperature code
http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/SensirionDocs.pdf
The section of the LCD program that starts with Main: is what you want to change and tC has the temperature in tenths of a degree Celsius. You'll have to take the temperature code, put the subroutines at the end of the LCD subroutines and put the temperature initialization code with the LCD initialization code. You'll have to combine the various variable and constant declarations as well. If you end up with too many variables, you'll have to figure out which variables are needed for which portions of the code and share them as needed using what's called aliases (see the Reference Manual for a description).
To output something like xxx.x from tC, you'd take what I showed in Post #7 and add a decimal point like this If you want to do zero suppression, you'll have to display spaces instead of zeros until the first non-zero digit is displayed. You'll need another (bit) variable to remember whether a non-zero digit has been displayed. The details are "an exercise for the reader". Remember that the decimal point should behave like a non-zero digit for this purpose.
If you really want to understand how to use the BS2sx, as Steph mentioned, you have to work through the "What's a Microcontroller?" tutorial with the Reference Manual at hand. Unless you're an experienced programmer, it's never enough to just look at a specific device's code. You have to try things out starting simply until you understand how things work.
How do u change the post solved?