Was watching Robocars last night and they were talking about the sensors used on the cars and how they paint the pictures and stuff. I was just thinking about how much fun it would be to code with one of these. Be able to just set it and a motor in the middle of a room and write a program that took that input and drew a picture of it for you or something. Now my question is, can these just be hooked up to USB or Serial? Or do you have to try to interface it through some sort of IC or what's the easiest way to get input from these things. Same with photosensors... Can they just be hooked up to usb and watched for input? Thanks, Alex
I have no idea what Robocars is (well, that's a lie - I guess it's 'robotic cars', but I've never seen it), but there aren't that many USB-connected sensors. You can get GPS which connects via USB, alongside a webcam (that'd be a photosensor, then), but that's about it. If you want anything esoteric you'll need to connect it up to a PIC and program it yourself. As far as telling a computer-connected object to paint a picture goes, check out the programming language LOGO and a commercially available turtle.
What the ones found walking along the street aren't good enough? j/k lol Thanks for your help I guess i'll just have to get the PIC working on it. Thank you.
Try here to get you started. I'm not recommending the company or its products - it was just the first Google hit I found to show you what I was talking about.
Thats microchip, they make PIC's, they arent a reseller, thats actually the manufacturer, if you were going to buy from anywhere, there would be the absolute best.
Yea, they made the PICkit2 so I've dealt with them before. What's the difference between looking it up to an IC though and USB? Wouldn't it send results either way? The only difference here in my mind is that the IC can evaluate it there the USB one would be able to get the data and evaluate it on the computer. Am I missing something?
For a device to communicate via USB it needs to understand the USB protocol. There are a whole bunch of flow control, parity, whole lot of other stuff that needs to be sent as well as the data. basically you could use a microcontroller as a usb controller for the device, using it to translate the output of the sensor into a format that can be transmitted over USB (many uCs have a usb controller built in to make this sort of interfacing easier).
Ah, very cool thank you. Need to start looking into that then, I didn't realize that about USB though. I assumed the data lines just carried whatever was sent across their lines then something on the PC decoded it and used it. I just figured I'd grab it as raw data and work with it from there but if it's different then obviously that won't work.