Author Topic: ARDUINO PROGRAMMING  (Read 1020 times)

0 Members and 1 Guest are viewing this topic.

Offline gunthervdeTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
ARDUINO PROGRAMMING
« on: June 02, 2012, 01:41:20 PM »
Hello,
I'm from Belgium,and new here and also new in programming.
I have a arduino to program
I want to make a robot with it
2 motor (left right)
2 bumpersensors
buttons: START STOP
When the robot hit something he has to stop for 2 seconds and than changing from direction turned under a angle.
Does anyone has experience with it, or can give me a good start to complete my gool?
Manny thanks.

Sorry if I make mistakes in my English writing, it's not my local language.

Kind Regards,

Offline idee17

  • Full Member
  • ***
  • Posts: 71
  • Helpful? 1
Re: ARDUINO PROGRAMMING
« Reply #1 on: January 24, 2013, 03:36:12 PM »
Well, I would first look a the arduino.cc webpage they have all kinds of helpful tutorials.

But what I would do is use two n-channel mosfets (if you don't know what they are look on youtube there are plenty of tutorials) to turn on and off the motors, you would need two 100k resistors to keep the mosfet in the "off" state. Then when a "bumpsensors" is turned to HIGH digitalWrite where one wheel rotates and the other doesn't this will give you a turn. Just set delay times so that the robot car will turn 90 degrees and be off on its merry way again =)

n-channel mosfets tutorial
Transistor / MOSFET tutorial

There are 10 types of people in the world: those who understand binary, and those who don't.

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: ARDUINO PROGRAMMING
« Reply #2 on: January 25, 2013, 04:03:26 AM »
Hello,
I'm from Belgium,and new here and also new in programming.
Hi and welcome :)

I have a arduino to program
To program Arduino You have at least 2 approaches:
  • Use Arduino IDE and their C Libraries, which are very handy, however somewhat restricted to Arduino devices only.
  • Use Atmel Studio 6 IDE and their C Libraries. This way gives You more flexibility later on if You don't want to use Arduino as this approach works for all Atmel microcontrollers

Personally, I never had MCU (augmented board like Arduino). What I did was bought ATmega48 microcontroller for 3 and used Atmel Studio to program it. I didn't get all ready made sockets/connections/pins (as You do with Arduino/Axon/other MCUs), but to start learning all I needed was prototyping board, few resistors, LEDs and caps to get everything connected to my microcontroller. This way, I learnt not only how to program microcontrollers, but also how to setup all hardware.

For useful AVRC tutorials try links in this post --> http://www.societyofrobots.com/robotforum/index.php?topic=14947.msg109175#msg109175

I want to make a robot with it
2 motor (left right)
To drive motors You need to have motor controller or H-bridge that exceed power requirements of motors. DON'T TRY CONNECTING MOTORS DIRECTLY TO MICROCONTROLLER - IT WILL RUIN IT!!! If You post motors specs, we might be able to guide You towards proper driver for them. There are many choices for motor drivers starting with ready built drivers, with all bells and whistles, like Sabertooth, going to IC H-bridges like L298, ending with custom/DIY built transistor H-bridges.

Regarding programming related to driving motors - You need to learn how timers and PWM work. Link to timer/PWM tutorial is provided in the post I link You to above.

2 bumpersensors
buttons: START STOP
To detect switch/button actuation You have to use interrupt feature of Your microcontroller. Here's post to get You started --> Newbie's Guide to AVR Interrupts.

Good luck :)
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline AscanioFX

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Re: ARDUINO PROGRAMMING
« Reply #3 on: January 26, 2013, 07:13:29 AM »
Well if you need to learn the basics for Arduino you can watch for tutorial on youtube. You can find almost everything there. I have learnd arduino and C programming just with Google and Youtube's tutorial and I have recently build a robot that does something like the one you are building.
Here is a link to a series of tutorial that teaches you the basics of Arduino that i would recommand.

Tutorial 01 for Arduino: Getting Acquainted with Arduino


Before starting building a robot I would suggest getting to know your platform, I started by playng with the arduino starter kit (that you can buy on the arduino store or any electronic webstore) that had almost everything inside to learn how it all works, then i realized i had a more clear idea of how I could do it and it just tooke few tiem for building the robot.

 


Get Your Ad Here

data_list