Arduino

Scratch 4tronix Initio Simulator

This is a Scratch app which simulates the line follower and avoiding of the 4tronix Inito robot. You can get these here http://4tronix.co.uk/blog/?p=169 and at ebay

Click here to open and use the Scratch App Robot Simulator 

The idea is that you can draw a track and get the robot to follow it.  You can also place wooden blocks and get the robot to avoid.  Scratch taught at most school snow – so just shows you what can be done.

Screen shot fo the Scratch app

Screen shot of the Scratch app

First thing to do is click the green flag.  Start the sim running.  You get a nice clean screen

start

Now click on Draw Track button and it will change to STOP. Then you can drag the cursor round to freehand draw a track or click with the mouse to draw lines between each click.

drawTrack

Click on STOP and place the robot near or on the red line.  Click Follow Track.  The robot should be able to follow the lines you have drawn. You can use the Rotate Robot button to line the sensors up if need be.

followTrack

You can also set up a small obstacle course with wooden blocks. Click Clear and then click on Show Blocks.  6 wooden blocks appear.  You can drag them around to make a course and if you click them – they will rotate.

obstacleCourse

Have fun with it.  The most interesting part is how the line is followed – and shows how good scratch can be for some things.

OpenALPR Install for RPI and UDOO and TRE and YUN

This is the way to install on Linux systems like RPI and UDOO – should work well.  thanks to Simon Eriksson

1. Remove the Tesseract and OpenCV packages with apt.  It seems the UDOO libs are at OpenCV 2.3.1 which wont work with the openalpr distro on github.

How to remove an apt application

2. Install all dependencies we will need:

sudo apt-get install autoconf automake libtool
sudo apt-get install libpng12-dev
sudo apt-get install libjpeg62-dev
sudo apt-get install libtiff4-dev
sudo apt-get install zlib1g-dev
sudo apt-get install git-core
sudo apt-get install cmake
sudo apt-get install liblog4cplus-dev libcurl3-dev uuid-dev
sudo apt-get install build-essential (you may already have this)

3. Clone the openalpr repo to the /home/pi directory and extract it:

cd /home/ubuntu  ( or /home/pi ) 
git clone https://github.com/openalpr/openalpr.git

4. Create a directory to hold our libraries and download them all:

cd openalpr
mkdir libraries
cd libraries
wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz
wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz
wget http://www.leptonica.org/source/leptonica-1.70.tar.gz
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.8/opencv-2.4.8.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencvlibrary%2Ffiles%2Fopencv-unix%2F2.4.8%2Fopencv-2.4.8.zip%2Fdownload&ts=1392199888&use_mirror=skylink
mv opencv-2.4.8.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencvlibrary%2Ffiles%2Fopencv-unix%2F2.4.8%2Fopencv-2.4.8.zip%2Fdownload opencv-2.4.8.zip

(the last step is required because of the way SF does its direct linking, there may be a better way to do this)

5. Extract all the packages ready to compile them:

tar -zxvf tesseract-ocr-3.02.02.tar.gz
tar -zxvf leptonica-1.70.tar.gz
unzip opencv-2.4.8.zip

6. Compile Leptonica:

cd leptonica-1.70
./configure
make
make install

7. Compile tesseract:

cd ../tesseract-ocr
./autogen.sh
./configure
make
sudo make install
sudo ldconfig
export TESSDATA_PREFIX=/home/pi/openalpr/libraries/tesseract-ocr/tessdata

8. Extract the tesseract language data:

cd ..
tar -zxvf tesseract-ocr-3.02.eng.tar.gz

9. Compile opencv:

Try this first – it has a good tutorial on OpenCV

http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html

cd opencv-2.4.8
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install

10. Update the CMakeLists for openalpr:

cd ../../../src
nano CMakeLists.txt
Change line 22 and 23 to:
SET(OpenCV_DIR "/usr/local/lib")
SET(Tesseract_DIR "/home/pi/openalpr/libraries/tesseract-ocr")

11. Compile openalpr:

cmake ./
make

That should then allow you to run as per the instructions on openalpr

http://www.openalpr.com/

 

 

Instructions for Ping Phase 1

Wiring Digram previous post

Log into DropBox

Got to sketches -> Arduino -> libraries

Download newping.zip

Copy NewPing library to your MyDocuments\Arduino\Libraries

On DropBox Got to sketches -> Arduino

Download PingPhase1.zip

Go into zip file – you see PingPhase1

Hit Control C – to copy

Navigate to  MyDocuments\Arduino\

Hit Control V – paste

Start Arduino

PING!!!!!

You need to show the serial output window – click the Arduino window as shown

 

serial