Let's Make Robots!

programming

General Programming - Debug

Maus's picture

Introduction

When I'm coding, depending on the programming language, I usually like to sprinkle debugging statements into my code to see data, code decisions and general information while the program is executing.  Using the Arduino, I can use the Serial library to stream print statements to the Serial Monitor for example.

Option 1: In code #if

The first option is very simple.  At the top of your source file, you put in the following line when you want to turn debugging code on:

#define DEBUG

Collect and crosspost my blog entries and discussions about programming topics.
Introduction I started blogging about various programming topics and the community has chimed in with some good information.  I plan on continuing to blog … Read more

Library Basics - Optimization

Maus's picture

The first Library Basics blog covered a basic conversion from a working sketch to a very simple library using the C++ class.  User mogul correctly pointed out some code optimizations that we can make.  His original message was:


You seem to waste a little resources here and there:

You store 4 private variables.

Library Basics - Baseline

Maus's picture

Introduction

 With all the questions surrounding libraries in the Arduino IDE, I thought I'd start my next blog about creating a class used as a library for my Ping sensor.  As a start, I'll use the example sketch from the Arduino examples.  Below is the example code created by David Mellis and Tom Igoe with the majority of the comments removed:


Original (uncommented) Sketch

pic kit 2

antony's picture

ok i bought a pic kit 2 because i finally got some money 
i have the pic kit
mplab

what else do i need or can i plug it all in and try to program with it?
i only have one pic chip for now  soo i dont want to make any mistakes 

A Robot Operating System

RobotBASIC's picture

We at RobotBASIC are currently working on a RobotBASIC Robot Operating System (RROS).

The full RROS will manage almost any type of sensor allowing hobbyists
without an electronics background to build and program sophisticated
robots.  The RROS will probably be distributed Open-Source to allow
expansion and customization.  We will even allow users to share their
modifications through our web page.  The LIGHT version is requiring
sensitive coding that will not be appropriate for modification, so it will

Arduino biped code

SimpleBotics's picture
I'm building a 4 servo biped robot, but I barely know any arduino. I just need a code for this bit to walk and then I could learn off that code for future robots. Thanks if you can help.
Embedded video: 
Helps newbies to learn how to program
Here I will try to explain general idea behind variables, one of the essentials of programming. And I will try to use following analogy: a glass of water. Here … Read more

Arduino to processing

flare's picture

So I have a Sharp IR sensor connected to my Arduino, feeding to my pc the values of its analog input, via the Serial connection.

To do this, I'm using the Serial.write() command. I want to be able to read these values into processing, but when I use the Serial.read() command in Processing, the values it picks up are nothing like what the Arduino Serial monitor is giving me, and are unaffected by the IR sensor.

What am I doing wrong, and how can I get processing to read these values from the IR sensor?

Any help is appreciated.

Servo coding (solved)

It is working now, thanks to everyone who helped me out!!!

 

 

I am trying to make my servo work,but if I start my arduino, with code and servo attached, it just goes to one position and stays there twitching. Can someone help me?

second try

Make Your Own PICAXE USB Program Cable

gecko's picture

Hi everyone!

I was just wondering if anyone else has made their own PICAXE program transfer cable?

I had all the equipment to make one, 2.5mm stereo jack, colour coded wire, a usb plug and soldering equipment; so I thought i'd give it a go!

The connections for the PICAXE cable seemed very simple (having only Serial in, Serial Out and Ground) and knowing that a usb's connections were quite similar (Ground, Data+, Data- and Vcc) so I tried to match them up.

Helps newbies to learn how to program
So, what are comments? They are exactly what they appear to be from their name. Comments or remarks are text that programmer put into code to improve readability of … Read more

Bluetooth control from your Android phone or tablet

Mintoris's picture

Hello, I am the author of Mintoris Basic for Android phones and tablets.  I recently added Bluetooth serial communications to the language with the intention of making it very easy to communicate and control robots.

Here is a short example program in Mintoris Basic which connects to a device then transmits data from the phones accelerometer.  So as you tilt the phone or tablet in any direction, the amount of tilt is sent to the Bluetooth device.

dim a$(0)
dim c(4)

' Get a string array of all the paired Bluetooth devices

a$()=BTGetPaired$()

Picaxe Serial Communication Through Prog. Socket??

Hey, I'm wondering: If I have 2 Picaxe 28X1's that both have their own programming sockets, after programming them, can I use a male to male audio cable and connect their sockets, and send information from one to the other with serout commands? One 28x1 sends info to the other, no data is sent back, so only on serial line is needed. Is it possible, and how would I implement it?

Helps newbies to learn how to program
Now it is Arduino’s turn to open the secret of “Blink a LED” to us. Arduino is heavily supported by a huge community, and is well documented. Read more

Picaxe questions

I started with an Arduinno because I read about it in Make Magazine (so very recently). I am considering trying Picaxe, because it seems as though the programming will be easier and I do not have a strong programming background (read: Basic in 1984).

Two quick questions:

Helps newbies to learn how to program
   So far we’ve been talking theory, but now it is time to make things blink! You might have heard of “Hello World” term in programming. All that “Hello … Read more
Saves time and avoids many related coding mistakes.
I have been learning about programming for years. More recently, I have been taught that magic numbers or constants should not be hard coded deep in your program. … Read more

Programming :S

So I'm trying to build the Start Here robot. I'm just playing around with the programming at the moment and have got a tad stuck on it, at first it wouldn't rrecognise the USB cable but I fiddled around with it and after a while managed to get it to recognise the USB connection and loaded the programe:

high 4

low 5

high 6

low 7

Helps newbies to learn how to program
“Hey, Chapter numbers are in binary!” could you say. And, yes, they are! And they are bytes. And we can have maximum number of 255. Will we go so far? Who … Read more

robot programming toolkits

Hello, 

It has been a while that I have not done any robots programming, so I need to update my skills.

What is the most recent robotics toolkit library? There are carmen and mrpt.org - but they both seem kind of old? What is the newest of such software, with community support? Are there any new ones?

Also, I dont want to work with arduino, nor pic - I have done both and I want to graduate from both of them? What would you guys suggest? ARM???

Best Regards,

C.B.

Helps newbies to learn how to program
Let’s start with a basic understanding of what program actually is. Program is a set of instructions for microcontroller to follow. A particular program is … Read more

Using an RF receiver/transceiver pair along with a wireless camera to process the images and send commands to a mobile robot

Markamas's picture

I would like to create a setup I will be using for a lot of my upcoming robots. A small wireless camera that will be ultimately outputting through USB to my computer. The computer processes the video and sends commands to the robot via RF. I guess the serial connection will be no more than 1900 bds. How can I coordinate RF and image-processing in a single program for autonomous navigation/other tasks (I can almost hear GroG saying "MyRobotLab" ;)?

Anyone using ROS?

airuno2l's picture

Hello all, 

I just downloaded ROS and intend to begin learning it throughly. Unfortunately, I'm learning to use Linux for the first time as well. In the past I always used Matlab for everything because I was in school and licenses weren't an issue for me. Now that I'm in "the real world" and see how much Matlab costs, I'm ready to move on. Not to mention ROS seems to have alot of great people working on it.

Microcontroller Programmer

GranTotem's picture

Hello Everyone!

I am currently thinking on moving from Picaxe to microcontroller as Picaxe isnt available except by buying outside the country and microcontroller in that way seems to be a cheaper solution.

After some research I discovered i need C knowledge which i dont posses. So i found out of BASIC just like Picaxe is.

Problem is: which programmer to use... I dont really want to buy one so I was thinking on a free tool that could program BASIC and then I could slowly move onto C.

Does anyone know of any "good" software that could do this?

 

Curiosity

Ya so a few topics I have a little gliches and I would want to know bout them. Firstly, instead of a picaxe or arduino board can i use a simple breadboard. IF yes, then please suggest a simple microprocessor, how to program it, AND WHERE TO PLUG IN THE USB OR RS CABLE TO??? Cause my conception is that the female usb jack is built on the picaxe board. Secondly, Suggest any other sensor than the SHARP. Any sensor even an audio one will do. Thirdly, I would appreciate if someone actually explained all the special components of a picaxe board. Thanks in Advance. :)

Ethical Bots?

MechGeek2000's picture

I found this article to quite interesting, though I don't think we are quite there yet.

http://www.physorg.com/news/2010-11-ethical-robot-video.html?ref=nf