Tag Archives: Programming

Stop [ \NoRegain ], ABB RAPID

MoveL point_1, v1000, z10, tool1;
TPWrite “Jog the robot to the position for pallet corner 1”;
Stop \NoRegain;
p1_read := CRobT();
MoveL point_2, v500, z50, tool1;

Program execution stops with the robot at point_1. The operator jogs the robot to p1_read. For the next program start, the robot does not regain to point_1, so the position p1_read can be stored in the program

Computer based instrumentation and micro controllers, FYS4240 / FYS3240

FYS4240 / FYS3240, is all about how Micro-controllers, PC Processors and busses are made and gives you a very wide perspective in choice of connection technologies and micro controllers. Topics from internal structure of micro controllers to interfaces on it and parallel programming on multi core / multi processor machines. It also includes LABView and C programming for AVR micro controllers in the lab assignments. This course is recommended to take by all electronics, Robotics students and I would have a much wider point of view if I had taken this course in the beginning of my studies (something that did not happen because of lack of communication between physics department and departments of informatic). Here you can download the exam paper for spring 2011. Continue reading

JavaMail, sending emails from your Java application

The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. The JavaMail API is available as an optional package for use with Java SE platform and is also included in the Java EE platform. Download JavaMail jar files from here. Full JavaMail API. For a full example with source code of JavaMail, click on “more” link down here. Continue reading

OpenCV installation Tutorial, MS Visual C++ 2008

Installing OpenCV might sound very easy when you read it on some forums/websites, but there are some small changes in most of these tutorials that prevent the connection between OpenCV and MS Visual C++. In this tutorial we(my dear friend Puya Afsharian and I) try to guide you through the installation of these two products and the right way to make them talk with each other.

Although people say it is easy to make OpenCV 2.2 to work with MS Visual C++ 2010, but we did not get it to work properly while it seems that MS visual c++ 2008 works perfect with OpenCV 2.1. Here are the download links for both products :

OpenCV 2.1 : http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.1/
This file is modified to work with MS Visual C++ 2008 and therefore there is no need to install CMake again.

MS Visual C++ 2008(Free of charge) : http://www.microsoft.com/downloads/en/details.aspx?familyid=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&displaylang=en

Click More down here to read the rest of the tutorial …

Continue reading

Arduino Ethernet shield problem when on External Power

When Arduino/ethernet shield is connected with an external voltage source I have to press reset button to make it work. But when I use it with the USB source everything works fine. This code is not exactly pretty, but it solves the problem of the need to restart on Ethernet shield startup. Open relay and hooked the coil pins to ground and digital pin 02, and the switched pins to ground and the reset pin. The trick is to before initializing the Ethernet library, check an address in EEPROM. If the flag is 0, we set it to 1 and then trigger the relay, and the unit resets. If the flag is 1, we assume that we just did a warm reset and set the flag back to 0, for next time we power up.

[java]
<pre>int relayPin = 02;
int addr = 128;

void eepThang() {
eep_value = EEPROM.read(addr);
if (eep_value == 1) {
Serial.println("already reset. writing 0");
EEPROM.write(addr, 0);
}
else {
Serial.println("not reset.. writing 1, restarting");
Serial.println(eep_value);
EEPROM.write(addr, 1);
Serial.println("done wrote… here we go");
digitalWrite(relayPin, HIGH);
delay(1000);
}
}</pre>
[/java]

source : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225354009/15

Processing, the key for Arduino board independent programming

When it comes to Arduino, there are several ways to do things. Using simple Arduino IDE to communicate with the board through serial port. Write a Java program to do it, or maybe do send orders to Arduino through your program that is not uploaded on Arduino card and can be changed anytime without even updating the pde file on the board. The tool that gives you  the power to do this is called Processing & the library used exactly for Arduino is called StandardFirmdata. The very good thing about Processing is that it is based on Java and all Java codes works right out of the box on it. You can also import processing libraries into your Java framwork and enjoy the power of processing right in the middle of your Java project(in Eclipse).

The instruction to get Processing & Arduino talk together :

  1. Download this file.
  2. Unzip the library and copy the “arduino” folder into the “libraries” sub-folder of your Processing Sketchbook. (You can find the location of your Sketchbook by opening the Processing Preferences. If you haven’t made a “libraries” sub-folder, create one.)
  3. Run Arduino, open the Examples > Firmata > StandardFirmata sketch, and upload it to the Arduino board.
  4. Configure Processing for serial:http://processing.org/reference/libraries/serial/
  5. In Processing, open one of the examples that comes with with the Arduino library(in the same folder that we just unzipped).
  6. Edit the example code to select the correct serial port.
  7. Run the example.