Let's Make Robots!

code

Pixy Out of Box

Well, it finally came in, the Pixy CMUcam5.

I'm still working with it, but wanted to make a real quick note about a few things.

learning code ... the ups and downs

Thought id post this example to show what im going through in the learning and understanding prossess of coding. For the most part it is very frustrating ... i would have very limited understandig at the moment and practically new to coding have tried before but stopped as other things came up.

But have started again and finding it hard going ... but am having some success ..

Number one reason is not being able to find any site with a teaching process .... have found some great sites that show very good tutorials eg tronixstuff ... 

Speech Recognition - Robot Thinking and Understanding

Programming a robot to do a single specific task such as following a line is hard enough for most people. So how do we program a robot so it can perform many different task? How do we command / control it?

Recently I have been wanting to use the speech and voice recognition of an Android mobile phone. My friend Bing wrote a simple app for me that allows my controller to connect to an Android phone via Bluetooth and then send the phone a list of words that I want the robot to recognize. For example: "OddJob,go,forward,backward,turn,stop"

Good Pan/Tilt Code (Code example included)

I recently did a small consulting gig and built a one-off robot for a customer. The gig included the hardware but also the client needed some example code to get himself up and running a bit quicker. This turned out to be a great oportunity for me to sit down and clean-up some code that I have been using for years, in this case, my pan and tilt code...

       Hello LMR, this is Penny the 3 servo hexapod. Penny is not just a very cheap way to build a hexapod but a very cheap way to build a robot, period. I … Read more

Arduino Code Troubleshooting - VEX Transmitter / Receiver

I'm trying to read the signals sent from the VEX transmitter to the VEX receiver through my Arduino Mega. I started with this code and then made some modifications to visualize the outputs.

arduino code

im working on the ankle servos, so im just using the example sweep, an i have them zeroed at 90 deg. I can get it from 90 to 180 an back but i cant get it to go 90 - 0.   

 

 

 

#include <Servo.h> 

 

Servo myservo;  // create servo object to control a servo 

 

 

int pos = 90;   

 

void setup() 

  myservo.attach(9);  

 

 

void loop() 

beginer in electronics needs to program

hi, im a twelve year old boy who is not an expert  AT ALL, but knows the basics

i've made bristlebots, speaker tones, dc motor cars  and other stuff

BUT

when i have to program  in arduino UNO i just copy other codes from other people

cause...  I dont know how to program at all!!!! i think arduino's language is c,and i don't know  how to program

 

anybody knows how to program arduino

and can give me a little tutorial about key words and etcetera like setup, delay, control of dc motors sensor etc...

Trying to use a light sensor to control a stepper motor

So this code finally works, how do i change it from a light sensor to infrared sensor?

int dirPin = 8;

int stepperPin = 7;

 

void setup() {

  Serial.begin(9600);

  pinMode(dirPin, OUTPUT);

  pinMode(stepperPin, OUTPUT);

  pinMode(A0, INPUT);

}

void step(boolean dir,int steps){

  digitalWrite(dirPin,dir);

  delay(50);

  for(int i=0;i<steps;i++)

  {

    digitalWrite(stepperPin, HIGH);

    delayMicroseconds(800);

How to contol servo speed from serial

Hello all

I have  renbotics ServoShield and I have made a code on arduino where from serialport I can send commads to servos and it happens with that way... S01P1200,S14P2300etc..I mean that  Servo 1 to 1200 posion and servo 14 to 2300 posion

Driving a CNC machine directly from an STL file with a DAGU Spider controller

I want to drive a CNC milling machine using only an Arduino processor and an STL file. The STL format was chosen because it is very simple for me to understand and almost all 3D CAD software can export an STL file.

In my forum post here: http://letsmakerobots.com/node/34958 the feedback I go was basically.

RF Link Help

I have been expiramenting with some RF links (tutorial here, RF link). The tutorial is great, but it only does serial communications. 

The code I use is 

 

// transmitter.pde

//

// Simple example of how to use VirtualWire to transmit messages

// Implements a simplex (one-way) transmitter with an TX-C1 module

//

// See VirtualWire.h for detailed API docs

// Author: Mike McCauley (mikem@open.com.au)

// Copyright (C) 2008 Mike McCauley

Need to find code for msp430 launchpad

this is my fisrt time using launchpad but I've used others microcontrollers before as pic16, pic18, or arduino.

I'm trying to read data from an ultrasonic sensor ping parallax and see it on the computer using USB and also I want to send it using SPI to a transceiver nordic nrf24l01 and in the other transceiver I allready got an arduino.

The full project is a quadcopter that read the distance when it is close to the ground and also I want to use automatic control to keep it in an specific distance no mather what, thanks for the help.

Arduino updates - I hate the new Arduino

When I started using Arduino, V0018 was the latest and greatest. Since then there have been about 7 updates and every time they update, more and more of my code fails to compile.

Since V1.0 and now V1.01 it seems the capital letter "F" cannot be used for a function name. This caused the error:
error: expected unqualified-id before 'reinterpret_cast'

programming arduino

So I made my first attempt at a robot using my Arduino...

It can be seen here, so that I don't have to explain how everything works again: http://letsmakerobots.com/node/31357

Now my problems is the code. What I have so far looks like so:

 

 

#include <IRremote.h>

#include <Servo.h> 

 

Servo run; // servo for running hind wheels, continuous rotation 

Servo steer; // Servo for steering

int pos = 0;

int RECV_PIN = 11; // IR pin

 

How to code this properly .....

Ok being distracted from my robot hack of late .... anyway being trying out the led tutorials on tronixstuff and have a little problem ...

 

Those of you that follow tronixstuff will have seen the tutorials on leds  ... im trying them out at the moment.  First tutorial is http://tronixstuff.wordpress.com/2010/04/04/getting-started-with-arduino-chapter-zero/

Video of problem at bottom of post

Upcoming Webinar: Embedded Code Generation for AC Motor Controllers

Cheers everyone,

Dropping this link just incase anyone is interested.  For what its worth, I have no professional affiliation with MathWorks outside that of using the software as a student.

Quoted from site -- " In this webinar we feature the development and implementation of a field-oriented controller for a permanent magnet synchronous machine (PMSM) using a real-time microcontroller. The workflow will show you how to:

Error coming up in code

copied this code from http://www.jeremyblum.com/2011/07/31/tutorial-13-for-arduino-liquid-crystal-displays/ but when i try to compile i get a error at void set up {}( function definition dose not declare parameters) i highlighted the part that gets this error ... but i can figure out whats wrong ...

 

/*

*RS: Pin 2

*EN: Pin 3

*D4: Pin 4

*D5: Pin 5

*D6: Pin 6

Why won't it vark?

I've made a development bot named Arcee as some of you know, now i've added an AmandaLDR to it for obstacle avoiding.The LEDs on the sensor are very bright and blue in colour. The bot won't use a servo to pan the sensor, it'll simply rotate itself.

The problem is, I don't think it's working. But the sensor works, oddly enough. It can turn an LED on at a threshold. But once implemented into an obstacle avoidance code it dosen't seem to work.

The code is attached below.

 

 

Arduino to processing

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.

IR RC code problems...

 

 

#include <IRremote.h>

#define m1F 6

#define m1R 7

#define m2F 5

#define m2R 8

 

long F = 1979994096;

long L = 1979994056;

long R = 1979994048;

long B = 1979994076;

long S = 1979994080;

int RECV_PIN = 4;

 

IRrecv irrecv(RECV_PIN);

 

decode_results results;

 

void setup()

{

  pinMode(13, OUTPUT);

  pinMode(m1F, OUTPUT);

  pinMode(m1R, OUTPUT);

  pinMode(m2F, OUTPUT);

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

My first hand written code.

I have just written my first code in Arduino IDE. The code should make a servo move to 180 degrees wait one second and then move back to 0 degrees and repeat.

Here it is :

 

#include <Servo.h>

 

Servo servo1;

int posR = 179;

int posL = 0;

 

void setup()

{

  servo1.attach(9);

}

 

void loop()

{  

  { 

     servo1.write(posR);

     delay(1000);

  }

  {

Support site for DAGU kits and products

G'day Everyone,

I have been designing products for DAGU for over 2 years now. During this time I have always tried to provide technical support and help in general here on LMR. I will still continue to do so but previously I had trouble uploading manuals because of upload limits.

I have been revamping the code for Mr. Tidy and it has grown large enough (23Kb when compiled) to be a real headache to scroll through. I know that some IDE's solve … Read more

sensor jitter problems? Let's fight back.

I wrote a tiny function in Arduino-C for my sensor-jitter problems. You can smooth out your sensor readings with this little function. You can input the smoothness and then get back the smoothed sensor value.

If somebody needs it - here it is:

// Jan Przybilla, Rosk, Farbtonstudio.de
// SSR - Smooth Sensor Readings
// Fight the (((Jitter)))!

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