Bar Graph (Advanced) What need to be change to have an output from the MAX186 s
sam_sam_sam
Posts: 2,286
This from my from my meter code
The scale for this one is· 0 to 50 C and a scale 0 to 125 F
I want to display it as a Bar Graph this code·using this what need to be changed
I also want to use this as well and I want to display it as a Bar Graph this code·using this what need to be changed
I aslo have where I to do the same thing with voltage 0 to 4 volts·
Thank to any one that can help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 5/4/2010 2:38:32 PM GMT
The scale for this one is· 0 to 50 C and a scale 0 to 125 F
SEROUT TX, T2400, [noparse][[/noparse]LcdCls] DO PAUSE 5 LOW CS ' Enable ADC SHIFTOUT DataIn, Clock, MSBFIRST, [noparse][[/noparse]%10111101] ' Select CH0, Single-Ended [noparse][[/noparse]%1XXX1101] SHIFTIN DataOut, Clock, MSBPOST, [noparse][[/noparse]KLN\12] ' Read ADC HIGH CS ' Disable ADC tC = KLN - 275 ' convert to tenths C SEROUT TX, T2400, [noparse][[/noparse]LcdLine1, "TC ", DEC TC] ' Displays voltages & digital value LOW CS ' Enable ADC SHIFTOUT DataIn, Clock, MSBFIRST, [noparse][[/noparse]%11111101] ' Select CH7, Single-Ended SHIFTIN DataOut, Clock, MSBPOST, [noparse][[/noparse]KLN1\12] ' Read ADC HIGH CS ' Disable ADC tC1 = KLN1 - 275 ' convert to tenths C SEROUT TX, T2400, [noparse][[/noparse]LcdBLon, LcdLine1_1, "TC1 ", DEC TC1] ' Displays voltages & digital value LOW CS ' Enable ADC SHIFTOUT DataIn, Clock, MSBFIRST, [noparse][[/noparse]%11001101] ' Select CH1, Single-Ended [noparse][[/noparse]%1XXX1101] SHIFTIN DataOut, Clock, MSBPOST, [noparse][[/noparse]results0\12] ' Read ADC HIGH CS Volts0 = results0 */ Cnts2Mv IF volts0 > 1 THEN SEROUT TX, T2400, [noparse][[/noparse]LcdLine1_2, "VT ",DEC Volts0 ] ELSE SEROUT TX, T2400, [noparse][[/noparse]LcdLine1_2, "V ____" ] SEROUT TX, T2400, [noparse][[/noparse]LcdLine2, " " ] PAUSE 100 ENDIF LOOP
I want to display it as a Bar Graph this code·using this what need to be changed
' -----[noparse][[/noparse] Initialization ]-------------------------------------------------- HIGH LCD ' Setup Serial Output Pin PAUSE 100 ' Give LCD Time To Settle Download_Chars: FOR index = 0 TO 45 ' Download Custom Characters READ CC0 + index, work ' Read EEPROM Data SEROUT LCD, Baud, [noparse][[/noparse]work] ' Send To LCD CGRAM NEXT SEROUT LCD, Baud, [noparse][[/noparse]LcdOn1, LcdBLon] ' Turn LCD Display & Backlight On ' Backlight Only On Backlit Models PAUSE 10 ' Allow LCD Time To Settle highVal = 255 ' You can change this value to any ' Non-Zero value ' -----[noparse][[/noparse] Program Code ]---------------------------------------------------- Main: DO SEROUT LCD, Baud, [noparse][[/noparse]LcdCls] ' Clear LCD Screen PAUSE 10 ' Must Follow CLS FOR index = 0 TO highVal ' Count To highVal can add (Step 100} GOSUB Disp_Graph ' Update Display NEXT PAUSE 5000 ' Wait 5 Seconds Then Repeat LOOP ' Forever STOP ' -----[noparse][[/noparse] Subroutines ]----------------------------------------------------- Disp_Graph: perCent = ((index * 100) / highVal) ' Draw index, highVal and perCent Values. This line can be removed. SEROUT LCD, Baud, [noparse][[/noparse]LcdLine1, DEC5 index, "/", DEC5 highVal, "=", DEC perCent, "%"] ' Draw Header And Left-Most, Solid Blocks SEROUT LCD, Baud, [noparse][[/noparse]LcdLine2, "0%", REP 4\(perCent MIN 1 - 1 / 10)] ' Draw Partial Block IF perCent > 0 THEN SEROUT LCD, Baud, [noparse][[/noparse](perCent - 1 / 2) // 5] ' Draw Right-Most, Blank Blocks And Footer SEROUT LCD, Baud, [noparse][[/noparse]REP 32\10 - ((perCent + 9) / 10), "100%"] RETURN
I also want to use this as well and I want to display it as a Bar Graph this code·using this what need to be changed
I aslo have where I to do the same thing with voltage 0 to 4 volts·
' -----[noparse][[/noparse] Initialization ]-------------------------------------------------- HIGH LCD ' Setup Serial Output Pin PAUSE 100 ' Give LCD Time To Settle Download_Chars: FOR index = 0 TO 72 ' Download Custom Characters READ CC0 + index, work ' Read EEPROM Data SEROUT LCD, Baud, [noparse][[/noparse]work] ' Send To LCD CGRAM NEXT SEROUT LCD, Baud, [noparse][[/noparse]LcdOn1, LcdBLon] ' Turn LCD Display & Backlight On ' Backlight Only On Backlit Models PAUSE 10 ' Allow LCD Time To Settle highVal = 5000 ' You can change this value to any ' Non-Zero value ' -----[noparse][[/noparse] Program Code ]---------------------------------------------------- Main: DO SEROUT LCD, Baud, [noparse][[/noparse]LcdCls] ' Clear LCD Screen PAUSE 10 ' Must Follow CLS FOR index = 0 TO highVal ' Count To highVal can add (Step 100} GOSUB Disp_Graph ' Update Display NEXT PAUSE 5000 ' Wait 5 Seconds Then Repeat LOOP ' Forever STOP ' -----[noparse][[/noparse] Subroutines ]----------------------------------------------------- Disp_Graph: perCent = (index / (highVal / 100)) ' Calculate Percent Value ' Draw index, highVal and perCent Values. This line can be removed. SEROUT LCD, Baud, [noparse][[/noparse]LcdLine3, DEC5 index, " / ", DEC5 highVal] ' Draw Header And Left-Most, Solid Blocks SEROUT LCD, Baud, [noparse][[/noparse]LcdLine1, "0% ", REP 4\(perCent MIN 1 - 1 / 10)] ' Draw Partial Block IF perCent > 0 THEN SEROUT LCD, Baud, [noparse][[/noparse](perCent - 1 / 2) // 5] ' Draw Right-Most, Blank Blocks And Footer SEROUT LCD, Baud, [noparse][[/noparse]REP 32\10 - ((perCent + 9) / 10), DEC perCent, " %"] SEROUT LCD, Baud, [noparse][[/noparse]LcdBLon ,LcdLine2,5,7,7,7,7,7, 6," KW"] RETURN
Thank to any one that can help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 5/4/2010 2:38:32 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 5/4/2010 2:35:01 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
also how do you scale the bar graph as well
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
How do you take the data that you have from the ADC part of the code and Put in·to the Bar Graph part of the code
There is where I am··I am ·REAL·Lost or just have REAL big brain f t
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 5/5/2010 8:33:49 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
Could you also post the code that you used
Thanks for your help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Yep, got the programs and code done last night here at work, however I had forgotten when I got home that my main PC is down and the HD had just arrived. I didn't have time to install it last night. I will get it back up tonight though. If you're not sure what I am talking about, see this post.
Or this one.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
I do understand and I did read·that post on your web site
Please take a much as you need I am in no big hurry· I just want to know how you do this
Thanks for you time and help in this project
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
Episode 5: Merging Programs Part 1 of 2
Episode 6: Merging Programs Part 2 of 2
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
That was a GREAT how to do video
···········································
·············································· That help alot
··································································
········································································ ·Thanks
····························································································· I got it to work
·································································································································· ···· · · up
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
The second part video (Episode 6) has been fully updated and posted at the link above. It gives more details than I thought I had time for originally.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
Thanks for taking the time to make this video. You explain alot in a clear manner that helps people like me really understand the thinking process in merging programs together. Well done!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
The info that you add at the end ·WAS GREAT··that helps alot Thank for all of your help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam