I would like to start experimenting with photosensors like the kind you get from radioshack or something. Just to get the basic IO worked out and stuff. SO what I was thinking was hook one up to my demo board that came with my PICkit 2 and hook it to some of the pins on the PIC16F887. Can I just do this and then put 2 outputs on the screen and tell it to print the data on the pins I attached it to to those outputs? What is the output like? Any tips would be great. Then, I am thinking of making a vb program that takes the input from either this or a sonar that I will experiment with also (once I get the basics worked out) then read through them and use them to manipulate the form. Does anyone know if the microchip PICkit2 programming software includes any kind of Visual Studio references or modules or anything? Language isn't an issue just as long as there's a class somewhere for it. Thanks, Alex
Reading your first post three times still left me confused. I believe that a photosensor's output is analog. If your chip doesn't have a built-in ADC, you might need one to read the input.
Why do people always say that? But I'm not actually sure I was under the assumption that they just took light input and sent numbers based on that through to the chip. What's an ADC? lol
I don't know why people always say that. I said that because I wasn't sure what exactly you were using, and what your exact goals are. There are technical aspects missing as well. Photosensor? So is it a photodiode, phototransistor, or photo-resistor, or other? Sometimes it makes a difference. What screen are you talking about. Printing? You want the controller to print to your display? Then what do you want the photosensor to "see"? You just want a reading of the ambient light levels and for that intensity to be displayed onto an ambiguous screen? Too many uncertainties, too much confusion. I said that I was confused just so in case I understood things inaccurately. ADC = analog to digital converter It does send back numbers, but some microcontrollers need an ADC to sort things out. A particular sensor might read an intensity of say, 3.4 volts, while the microcontroller might want it input as a digital value. An 8 bit ADC takes the voltage range and converts it into numbers, say a range from 0 to 255. I'm a little rusty, but I think this is right.
Ok, thanks I'll clarify for you. I said photosensor because I wanted to be general because actually I haven't really looked into it I was hoping for some input on what would be best. By print I meant text in a debug window. What I'm trying to do with this is see what kind of output it has so I can figure out how to use the data. I'm trying to see, say, if I point it to a black surface that is lit what kind of number it would give me as compared to a white piece of paper and stuff. Basically just experimenting. Also, do you have any idea how I can look up whether I'd need an ADC or not? Thanks, Alex
Whether you need an ADC or not should be mentioned in the datasheet or info for your PIC chip. It might not even be needed, depending on how you want to do things.