well, once you have the lcd working.. it's just a matter to have few IF-THEN conditions with your ADC value and few HIGH/LOW lines, and you should be in business... maybe i've misundertood something?
well, once you have the lcd working.. it's just a matter to have few IF-THEN conditions with your ADC value and few HIGH/LOW lines, and you should be in business... maybe i've misundertood something?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I like this one. http://www.rentron.com/PICX2.htmDoes anyone know any code that will do that or give me a starting place to play with?
It is a little more complicated than ADCIN, but it is still the method I use.
Follow the code with the data sheet and it should become clear how the ADC works. Complete control.
Dave
Always wear safety glasses while programming.
Your forgetting im a Pseudo Blonde
I've no idea how to start off with ADC values or how to use them (at the moment) I've found the easiest way to learn something is by following examples that show you how to get started and then playing from there thats how I got the LCD working in the first place, and then the bargraph, then inputs and outputs... learning.. slowly!
No i didn't forget
let's see first example in this thread
You just need to monitor Value variable with some IF-THEN statements after ADCIN lineCode:; Initialize your hardware and LCD first. DEFINE ADC_BITS 8 ' Number of bits in ADCIN result ADCON1.7 = 1 ' Right Justify AD result INCLUDE "LCDbar_INC.bas" ' Include the BARgraph routines Value VAR WORD ' Must be a WORD even though AD is 8bit LCDOUT $FE, 1 ' Clear Screen Loop1: ADCIN 0, Value LCDOUT $FE,2,"Value = ",DEC Value," " ; syntax- BARgraph Value, Row, Col, Width, Range, Style @ BARgraph _Value, 2, 0, 16, 255, lines GOTO Loop1
Code:IF Value>200 then LCDOUT $FE,2,"VALUE>200 " endif
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks
I think I'm starting to get parts of it I'll try tomorrow properly when my head isn't so tired
however i do have one question, how do you tell the pic what port the input is on?
ie if the pot was connected to portA.0 how would you tell the pic to measure and display the value of that port?
Hope I've said that clearly enough, sometimes I'm better about thinking about things than trying to explain what I mean
ADCIN 0, Value
check the datasheet, PORTA.0 is AN0
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I will use it to cell voltage indicator project
Bookmarks