couldn't find a leonardo on the selected port linux ubuntu 12

hello, first time posting, i have few questions:

  1. while i am able to upload sketches from my windows 7 laptop but i can not seem to get my ubuntu 12.04 laptop to work. in the tools menu there are no serial port choices [it is grayed out] how do i fix that? i have poured through the forums and found others with the same error "couldn't find a leonardo on the selected port" but all of them suggest they have at least one existing port, where as i have zero? ironically i'm a bit of a linux noob even though i worked primarily with UNIX and IRIX systems for most of the 90's i must of forgotten or i am out of date, so give as much detail as possible and assume i know nothing [or point out some good placed to refresh my knowledge of basic linux]

  2. i can not seem to find any help on using the arduino robot, the closest i seem to get is the arduino leonardo? if anyone has any good links for beginning programming especially using sensors please let me know. for example i goto the webpage of a sensor and get the following code: Adjustable_Infrared_Sensor_Switch__SKU_SEN0019_-DFRobot

const int InfraredSensorPin = 4;//Connect the signal pin to the digital pin 4
const int LedDisp = 13;

void setup()
{
Serial.begin(57600);
Serial.println("Start!");
pinMode(InfraredSensorPin,INPUT);
pinMode(LedDisp,OUTPUT);
digitalWrite(LedDisp,LOW);
}

void loop()
{
if(digitalRead(InfraredSensorPin) == LOW) digitalWrite(LedDisp,HIGH);
else digitalWrite(LedDisp,LOW);
Serial.print("Infrared Switch Status:");
Serial.println(digitalRead(InfraredSensorPin),BIN);
delay(50);
}

but i'm not sure how to translate it to work with the same code from the examples for the robot_control [file -> examples -> explore -> R07_runaway_robot]

/* Runaway Robot

Play tag with your robot! With an ultrasonic
distance sensor, it's capable of detecting and avoiding
obstacles, never bumping into walls again!

You'll need to attach an untrasonic range finder to TK1.

Circuit:

  • Arduino Robot
  • US range finder like Maxbotix EZ10, with analog output

created 1 May 2013
by X. Yang
modified 12 May 2013
by D. Cuartielles

This example is in the public domain
*/

// include the robot library
#include <ArduinoRobot.h>

int sensorPin = TK1; // pin is used by the sensor

void setup() {
// initialize the Robot, SD card, and display
Serial.begin(9600);
Robot.begin();
Robot.beginTFT();
Robot.beginSD();
Robot.displayLogos();

// draw a face on the LCD screen
setFace(true);
}

void loop() {
// If the robot is blocked, turn until free
while(getDistance() < 40) { // If an obstacle is less than 20cm away
setFace(false); //shows an unhappy face
Robot.motorsStop(); // stop the motors
delay(1000); // wait for a moment
Robot.turn(90); // turn to the right and try again
setFace(true); // happy face
}
// if there are no objects in the way, keep moving
Robot.motorsWrite(255, 255);
delay(100);
}

// return the distance in cm
float getDistance() {
// read the value from the sensor
int sensorValue = Robot.analogRead(sensorPin);
//Convert the sensor input to cm.
float distance_cm = sensorValue*1.27;
return distance_cm;
}

// make a happy or sad face
void setFace(boolean onOff) {
if(onOff) {
// if true show a happy face
Robot.background(0, 0, 255);
Robot.setCursor(44, 60);
Robot.stroke(0, 255, 0);
Robot.setTextSize(4);
Robot.print(":)");
}else{
// if false show an upset face
Robot.background(255, 0, 0);
Robot.setCursor(44, 60);
Robot.stroke(0, 255, 0);
Robot.setTextSize(4);
Robot.print("X(");
}
}

With Ubuntu your user needs to belong to the "dialout" group to have access to the /dev/ttyACM* ports.

did you select the right board?

try lsusb on commandline before and after connecting the leonardo to check whether your system detects the new usb device connected.

thanks becoming root and then opening arduino from the terminal worked