Pages: [1]   Go Down
Author Topic: Setting and calling defined settings  (Read 530 times)
0 Members and 1 Guest are viewing this topic.
Vlissingen Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Howdy to you all.

I have a "aar-04 robot" manufactured by Arexx and it has arduino board to program.


I'm wondering how to make multiple predefined code and call them in the program like;

definition1 call pin1 set to high
defenition2 blink 4 times pin8

then program various things
blabla
then when x reach >20 launch defenition1
blabla
blabla
then when y reach >1000 launch defenition2

etc

Anyone knows how to pull this off?
Thanks
« Last Edit: December 30, 2012, 07:29:55 am by FreakyDuino » Logged

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2385
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For the Arduino we use C/C++. Start here http://arduino.cc/en/Tutorial/HomePage

Mark
Logged

Vlissingen Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for pointing me in the right direction Mark.

That it is C/C++ i know, but should i use the if statement to create all the definitions for what i want to do then?
If so it's really plain and simple but a lot to program (but it's part of the fun  smiley )
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26525
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but should i use the if statement to create all the definitions for what i want to do then?
I'm afraid that doesn't make a great deal of sense to me.

You can create functions to perform actions, you can define variables, you can create macro definitions...
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2385
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you really need to look at what the Arduino is and how a language like C/C++ works.

But understand there is no OS, at all, of any kind. All there is, is you and the hardware.

I've not hand a look at that Ardu-bot, as a robot it looks good!. But is you really want to learn take a look at something like this
http://www.oomlout.co.uk/starter-kit-for-arduino-ardx-p-183.html?zenid=afb2b817a842779d952b503220bde13a

You may want to put the Ardu-bot away for a while and work with the starter kit.

Mark
Logged

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2385
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Make sure that you use re-chargeable batteries.

With only 4 batteries (6V) I think it will start to misbehave after 1 or 2 hours use.

Mark
Logged

Vlissingen Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the tip of the battery's, i thought it wouldn't work well for long...

And yes need to learn from real basic, never used C/C++ before so try to get familiar with it.
I was looking in to a starting kit, this one looks great.

That there is no OS i do understand, done Microchip Pic's years ago, but i thought arduino would be a better choice to
manage all kinds of projects.

Thanks again
Logged

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2385
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Uno runs at 16 MHz and only does serial i/o. This means no cameras (not even stills). Think more washing machine than what people would normally say was a computer!.

Mark
Logged

Pages: [1]   Go Up
Jump to: