EzDevInfo.com

arduino interview questions

Top arduino frequently asked interview questions

How can I unit test Arduino code?

I'd like to be able to unit test my Arduino code. Ideally, I would be able to run any tests without having to upload the code to the Arduino. What tools or libraries can help me with this?

There is an Arduino emulator in development which could be useful, but it doesn't yet seem to be ready for use.

AVR Studio from Atmel contains a chip simulator which could be useful, but I can't see how I would use it in conjunction with the Arduino IDE.


Source: (StackOverflow)

Getting started with Arduino? [closed]

I'm going to get an Arduino starter kit like the one below.

https://www.sparkfun.com/products/9905

  • What else do I need to get started?
  • What are some good Arduino programming resources?
  • What else can I buy/acquire to make my first embedded programming experience more pleasant?
  • What are some good beginner projects?

Source: (StackOverflow)

Advertisements

Converting an int or String to a char array on Arduino

I am getting an int value from one of the analog pins on my Arduino. How do I concatenate this to a String and then convert the String to a char[]?

It was suggested that I try char msg[] = myString.getChars();, but I am receiving a message that getChars does not exist.


Source: (StackOverflow)

How to convert int to string on Arduino?

How do I convert an int, n, to a string so that when I send it over the serial, it is sent as a string?

This is what I have so far:

int ledPin=13;
int testerPin=8;
int n=1;

char buf[10];

void setup()
{
    pinMode(ledPin, OUTPUT);
    pinMode(testerPin, OUTPUT);
    Serial.begin(115200);
}

void loop()
{
    digitalWrite(ledPin, HIGH);
    sprintf(buf, "Hello!%d", n);
    Serial.println(buf);
    delay(500);
    digitalWrite(ledPin, LOW);
    delay(500);

    n++;
}

Source: (StackOverflow)

How to unpair or delete paired bluetooth device programmatically on android?

The project is to use my android phone to connect with my arduino devices. but how can I unpair the paired ones. I see it seems the paired list is stored where bluetoothadapter could retrieve anytime.

PS: 1st, I know long press paired device will unpair it.
but the question here is how can I make this happen programmatically?

2nd, I have checked bluetoothdevice and bluetoothAdapter class, there is no function to implement this.

thanks.


Source: (StackOverflow)

What's the difference/relationship between AVR and Arduino?

I've been interested in hardware programming recently, but I have not started yet.

I did some searching working, and have a vague idea:

Arduino is a combination of both chip and breadboard.

AVR is a single chip, and need to buy a breadboard to get started.

Is that statement true or false?


Source: (StackOverflow)

Arduino Sketch upload issue - avrdude: stk500_recv(): programmer is not responding

I have an Arduino Duemilanove with an Atmega 328. I am working on Ubuntu 12.04, and the Arduino IDE's version is 1.0. Recently, I tried to upload a few of the sample sketches onto it, such as the Blink one. However, none of my attempts are working and they result in the same error every time I try it - avrdude: stk500_recv(): programmer is not responding.

enter image description here

I have enabled '/dev/ttyUSB0' under Tools -> Serial Port. I have also selected the correct board (Duemilanove with Atmega 328) from the list. Yet, I am not able to resolve the issue. I have searched online as well and none of the other responses for this problem seem to be working for me. Could someone tell me why I am encountering this issue and help me resolve it?

Update: I tried turning the onboard Atmega and fitting it in the other direction. Now, I encounter no problems uploading, but nothing happens afterwards. The onboard LED also does not seem to be blinking.


Source: (StackOverflow)

Looking for ways for a robot to locate itself in the house

I am hacking a vacuum cleaner robot to control it with a microcontroller (Arduino). I want to make it more efficient when cleaning a room. For now, it just go straight and turn when it hits something.

But I have trouble finding the best algorithm or method to use to know its position in the room. I am looking for an idea that stays cheap (less than $100) and not to complex (one that don't require a PhD thesis in computer vision). I can add some discrete markers in the room if necessary.

Right now, my robot has:

  • One webcam
  • Three proximity sensors (around 1 meter range)
  • Compass (no used for now)
  • Wi-Fi
  • Its speed can vary if the battery is full or nearly empty
  • A netbook Eee PC is embedded on the robot

Do you have any idea for doing this? Does any standard method exist for these kind of problems?

Note: if this question belongs on another website, please move it, I couldn't find a better place than Stack Overflow.


Source: (StackOverflow)

In what language is the Arduino IDE written, C or C++? [closed]

Coming from Python, the whole C/C++ thing is kind of alien to begin with... and then I see in one place that Arduino uses 'standard' C, and in another that it uses 'standard' C++, so on and so forth.

Sources are conflicted about what exactly Arduino uses.

Is it C? Suggested here.

Or is it C++? Suggested here.

Which is it? What is the relationship between the C, C++ and code written using the Arduino IDE? What should I concentrate on learning if I want to program the Arduino?


Source: (StackOverflow)

Is there a way to "compile" Python code onto an Arduino (Uno)?

I have a robotics type project with an Arduino Uno, and to make a long story short, I am experimenting with some AI algorithms. However, I need to implement some high level matrix algorithms that would be quite simple using NumPy/SciPy, but they are an utter nightmare in C or C++. Even with the libraries out there, this is just getting ridiculous.

Is there any way I can do this project in Python? I think I heard something about the Mega having this capability, but I have an Uno, and replacing it is not an option at this point (that would set the project back quite a bit.) Also, I heard somethings about using Python to communicate to the Arduino via USB, but I cannot have the USB cable in while the thing is running. I need to be able to upload the program and be done with it.

Are there any options out there, or have I just reached a dead end?


Source: (StackOverflow)

Arduino Emacs development

I would like to use Emacs as a development environment for Arduino programming. What are some tips or links to use Emacs to program Arduino?

Is there an official (or de facto) Emacs mode?

Also, am I going to miss something in Arduino IDE if I use Emacs exclusively?


Source: (StackOverflow)

Does it matter which microcontroller to use for 1st time embed system programmer?

I've experience in doing desktop and web programming for a few years. I would like to move onto doing some embed system programming. After asking the initial question, I wonder which hardware / software IDE should I start on...

Or... doesn't matter?

Which development platform is the easiest to learn and program in (take in consideration of IDE usability)?

Which one is the easiest to debug if something goes wrong?

My goal is to learn about "how IO ports work, memory limitations/requirements incl. possibly paging, interrupt service routines." Is it better to learn one that I'll use later on, or the high level concept should carry over to most micro-controllers?

Thanks!

update: how is this dev kit for a start? Comment? suggestion?


Source: (StackOverflow)

Vectors in Arduino

I am making a vector of "waypoints" on the Arduino. Each waypoint is an object. The Arduino will obviously need to store multiple waypoints for waypoint navigation. But instead of storing these waypoints in a standard preprogrammed array, the user will need to be able to add, remove waypoints and move them around. Unfortunately the Arduino does not offer a vector type as a built-in library.

I am currently contemplating two options:

  1. In Container for objects like C++ 'vector'?, someone posted a general purpose library. It does not contain any index deletion, or movement operations. But it does contain some memory management strategies.

  2. I have used malloc, dealloc, calloc in the past. But I do not like that option at all, especially with classes. But is this a better option in my senario?

Which one is a better path to go down?


Source: (StackOverflow)

How to use c++11 to program the Arduino?

How can I use c++11 when programming the Arduino? I would be fine using either the Arduino IDE or another environment. I am most interested in the core language improvements, not things that require standard library changes.


Source: (StackOverflow)

Arduino Due HTTPS Support

In previous versions of Arduino, the limiting 8-bit microcontroller board, it seems that implementing HTTPS (not merely HTTP) was almost impossible. But the newer version of Arduino Due provides 32-bit ARM core - see spec here.

I tried to check several network libraries (libcurl, openssl, yaSSL), but I didn't find anyone that was already ported to work with Arduino Due.

OpenSSL is probably too heavy to be able to run on this processor, but I believe that yaSSL as an embedded library should be possible to do.

Do you have any information of a library that I can use to trigger HTTPS requests on Arduino Due?


Source: (StackOverflow)