In order to get the scanner working I had to make a program that could convert light sensor readings into an image. This was done using Visual Basic andspirit.ocx. The program called ScanControl allows you to chose between two different resolution of about 25 dpi and 50 dpi – this means that the scanner head moves with an accuracy of about 0.5 mm. For this purpose I used a very low gearing as seen on the pictures. The downside of using such a low gearing is that scanning a cd cover takes 3-4 hours at 25 dpi. But the results are quite good as you can see…
Scan Control
- Download firmware to the RCX.
- Compile and download the program used to control the LEGO scanner.
- Set the width and height of the scan.
- Chose between two different resolutions.
- Preview the scanned image while scanning.
- Save the scanned image.
The way that ScanControl works is actually pretty strait forward. First you will have to download both firmware and the program that controls the RCX. This program consists of three tasks that can be called from the Visual Basic program. The three tasks do the following:
- Move the scanner head in either direction.
- Feed the paper.
- Compensate for gear backlash when the scanner changes direction.
Before scanning the image the width and height of the scan is adjusted – this is done with a setting wizard that also lets you chose between two different resolutions as well as adjust the sensor values that corresponds with bright and dark colors. Furthermore the wizard lets you feed the paper and move the scanner head. To scan the image the program moves the scanner head and the takes a sensor reading. This is then converted into a color. This is repeated until the scanner head reaches the end of the image where the scanner feeds the paper and the scanner head changes direction. All this is then repeated until the scanner has scanned the entire image.
Follow