Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15338
Measurement changes behavior
|
 |
« Reply #15 on: January 23, 2012, 04:23:59 pm » |
Hi All I am still looking for anyone to help with the code for my project. One again, this is a PAID gig. I am one week away from the due date and is still in the testing stage. I can drive the servos and I can test the sensors using the serial monitor but is yet to have the sensor and the servo working together.
It's been almost three months sense your original posting and with one week to blast-off, I assume it's not going to happen you you. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Leighton Buzzard, UK
Offline
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #16 on: January 23, 2012, 04:26:39 pm » |
#801 here I'll take a look you can PM or email me
cheers Mike
PS UK based, but electrons get everywhere!
|
|
|
|
|
Logged
|
there are only 10 types of people them that understands binary and them that doesn't
|
|
|
|
Leighton Buzzard, UK
Offline
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #17 on: January 23, 2012, 04:31:31 pm » |
hmm emails are bouncing very strange The original message was received at Mon, 23 Jan 2012 21:30:58 GMT from localhost.localdomain [127.0.0.1] ----- The following addresses had permanent fatal errors ----- < electric_al@hvc.rr.com> (reason: 550 5.1.1 - Invalid mailbox: electric_al@hvc.rr.com)
|
|
|
|
|
Logged
|
there are only 10 types of people them that understands binary and them that doesn't
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #18 on: January 23, 2012, 07:44:29 pm » |
It looks like jumpjack tried to contact you.
I'm sure there's many people who are happy to help with a specific problem, maybe those that can do the work are already occupied.
If I read correctly you need to
run for 4 seconds return to start run for 8 seconds return to start run for 12 seconds return to start run for 16 seconds return to start
Is that it? ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16572
Available for Design & Build services
|
 |
« Reply #19 on: January 23, 2012, 07:58:18 pm » |
No, he wanted to use ultrasonic sensors & stuff.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #20 on: January 23, 2012, 09:02:01 pm » |
Just as an over/end of travel measure though isn't it?
______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
New York
Offline
Newbie
Karma: 0
Posts: 18
Ignorance is curable with education. Stupidity is refusing to be educated.
|
 |
« Reply #21 on: January 23, 2012, 09:15:11 pm » |
hi All, email addy is good, just gave Time Warner Cable a piece of my mind.
this is correct:
run for 4 seconds return to start run for 8 seconds return to start run for 12 seconds return to start run for 16 seconds - by now should reach end of track then do the same from the other direction.
the sensors are to detect the end of the track.
|
|
|
|
|
Logged
|
Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming
WOW!!! What a Ride!
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #22 on: January 23, 2012, 10:48:51 pm » |
then do the same from the other direction. What does this mean? Move to the other end then repeat the above but reversed? ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16572
Available for Design & Build services
|
 |
« Reply #23 on: January 23, 2012, 11:12:06 pm » |
A B C D E 5 track positions A-B-A A-C-A A-D-A A-E E-D-E E-C-E E-B-E E-A repeat
|
|
|
|
|
Logged
|
|
|
|
|
New York
Offline
Newbie
Karma: 0
Posts: 18
Ignorance is curable with education. Stupidity is refusing to be educated.
|
 |
« Reply #24 on: January 24, 2012, 12:21:01 am » |
Exactly!
A B C D E 5 track positions A-B-A A-C-A A-D-A A-E E-D-E E-C-E E-B-E E-A
thanks repeat
|
|
|
|
|
Logged
|
Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming
WOW!!! What a Ride!
|
|
|
|
New York
Offline
Newbie
Karma: 0
Posts: 18
Ignorance is curable with education. Stupidity is refusing to be educated.
|
 |
« Reply #25 on: January 24, 2012, 08:55:21 am » |
Additionally, I am also in need of an Arduino program to make a lap timer.
The board: Mega 2560 The Sensors: Sharp Proximity sensors = (no contact triggering is a must) LCD display: TBD
THe Idea: how long it takes ( seconds/minutes) for my Trolley to travel 10feet of track and display it on a lcd screen and be resettable. Something similar to a Slot Car lap timing system.
Paid!
|
|
|
|
|
Logged
|
Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming
WOW!!! What a Ride!
|
|
|
|
Leighton Buzzard, UK
Offline
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #26 on: January 24, 2012, 09:25:37 am » |
while I'm there I can do that as well all integrated in one package or two separate (but related) projects?
|
|
|
|
|
Logged
|
there are only 10 types of people them that understands binary and them that doesn't
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #27 on: January 24, 2012, 10:52:09 pm » |
Here's a rough prototype of some code that should make a start. #define SECTION_TIME 1000 // # of mS to travel a section #define FOWARDS 1 #define BACKWARDS 0
volatile boolean stop;
void startMotors (int direction) {}; // you write these void stopMotors () {};
void move (int sections, int direction) { long time_to_travel = sections * SECTION_TIME; long start_time = millis(); long stop_time = start_time + time_to_travel; startMotors (direction); while (millis() < stop_time && !stop) {} stopMotors(); stop = false; }
void fontSensor_ISR() { stop = true; }
void backSensor_ISR() { stop = true; }
void setup () { attachInterrupt (0, fontSensor_ISR, RISING); attachInterrupt (1, backSensor_ISR, RISING); }
void loop () {
move (1, FOWARDS); // move to A move (1, BACKWARDS); move (2, FOWARDS); // move to B move (2, BACKWARDS); move (3, FOWARDS); // move to C move (3, BACKWARDS); move (4, FOWARDS); // move to D move (4, BACKWARDS); move (6, FOWARDS); // move to E (stopped by sensor)
move (1, BACKWARDS); // move to D move (1, FOWARDS); move (2, BACKWARDS); // move to C move (2, FOWARDS); move (3, BACKWARDS); // move to B move (3, FOWARDS); move (6, BACKWARDS); // move to A (stopped by sensor) delay (1000);
}
It assumes that you get an interrupt from the sensors if you get too close, but now that I think about it that probably is not the case so that should be changed. Can you use that as a start and build it from there? I could not get onto the forum most of yesterday so didn't see the new requirements. ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #28 on: January 24, 2012, 10:54:31 pm » |
Here's a version with no interrupts. #define SECTION_TIME 1000 // # of mS to travel a section #define FOWARDS 1 #define BACKWARDS 0
void startMotors (int direction) {}; // you write these void stopMotors () {}; boolean toCloseFront () {}; boolean toCloseBack () {};
void move (int sections, int direction) { long time_to_travel = sections * SECTION_TIME; long start_time = millis(); long stop_time = start_time + time_to_travel; startMotors (direction); while (millis() < stop_time) { if (direction == FOWARDS && toCloseFront()) break; if (direction == BACKWARDS && toCloseBack()) break; } stopMotors(); }
void setup () { }
void loop () {
move (1, FOWARDS); // move to A move (1, BACKWARDS); move (2, FOWARDS); // move to B move (2, BACKWARDS); move (3, FOWARDS); // move to C move (3, BACKWARDS); move (4, FOWARDS); // move to D move (4, BACKWARDS); move (6, FOWARDS); // move to E (stopped by sensor)
move (1, BACKWARDS); // move to D move (1, FOWARDS); move (2, BACKWARDS); // move to C move (2, FOWARDS); move (3, BACKWARDS); // move to B move (3, FOWARDS); move (6, BACKWARDS); // move to A (stopped by sensor) delay (1000);
}
______ Rob
|
|
|
|
« Last Edit: January 24, 2012, 10:59:59 pm by Graynomad »
|
Logged
|
|
|
|
|
Leighton Buzzard, UK
Offline
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #29 on: January 25, 2012, 04:11:21 am » |
just for the thread I'm on the case now got a solution working not too far from the method suggested by Rob (Graynomad) 
|
|
|
|
|
Logged
|
there are only 10 types of people them that understands binary and them that doesn't
|
|
|
|
|