Loading...
  Show Posts
Pages: 1 ... 14 15 [16] 17 18
226  Using Arduino / Project Guidance / Re: Turning left or right (2 motors) on: July 21, 2011, 01:13:32 pm
im going to pwm them with my arduino, with an external power supply obviously, and using a separate arduino with accelerometer and rf links to make a sort of tilting remote for it, i have the remote ready now my receiver part is yet to be determined , but the way i have it set up right now is i have a range of let say 200 to -200 because its hard to keep it flat at zero while holding it, so if its in that range its at a normal cruising speed, tild forward past that range and there is another range for speed 1 and then a speed 2, same goes for reverse and turning, now the turning part i was thinking when i reach range 1 reduce speed of one motor by 25% of the current forward speed it has, and maybe a 75% for second turning speed
227  Using Arduino / Project Guidance / Turning left or right (2 motors) on: July 21, 2011, 01:04:28 pm
I understand the concept of turning let or right just turn off one and leave the other one on and it will turn on direction , but this sort of stop-and-turn is impractical
like if you had to stop your car completely to make a turn, so i am assuming to turn while still maintain some minimal bit of drive , instead of stopping one motor completely, you just reduce the speed of it and you will get a turn, and the bigger the difference in speeds of both motor depends on how fast it will turn?
am i getting it right here?
because im making a little bot but i have not received the motors yet so i am just writing up some pseudo code right now and it revolves around this "reduction" of speed to turn as oppose to just having one motor high and the other off. 
228  Using Arduino / Project Guidance / Re: Sensors to sense hand swiping across on: July 18, 2011, 05:34:14 am
gosh you pretty much came up with what would of taken me some gray hairs to figure out in a matter of minutes , i like the idea of a time stamp which gives for a more accurate reading and thus a better "feel" for the user who can swipe as fast or slow through images as they would like..

touché
229  Using Arduino / Project Guidance / Re: Sensors to sense hand swiping across on: July 18, 2011, 05:03:29 am
ahh TIME!!!! that single word  did it!! very good point .  thank you kind man
230  Using Arduino / Project Guidance / Re: Sensors to sense hand swiping across on: July 18, 2011, 04:51:36 am
the problem with my second way of doing it is that, lets say if i swipe from right to left , where do i store the value of lets say sensor 1? how is it going to know that he was the first one swiped and store his number in the first slot of the array or if he was the last one activated and store his value in the last slot of the array..??? mayybe check if a defualt space holder is already there that means he should put it there if not then another number will be there so that means he must of been the last one swiped..get it?
231  Using Arduino / Project Guidance / Sensors to sense hand swiping across on: July 18, 2011, 04:47:47 am
Hey fellas, i know i ask more then what i actually contribute to the forum but i am getting there slowly , anyways my question is as follows
If i have a row of sensors weather its PIR or IR or well anything that can sense my hand/body heat , how can i make it so it recognizes when i have swiped my hand from one direction to the other and vice versa , for example if you look at the video under the Make: magazines book page on amazon about 20 seconds into the video there is a man swiping his hand across some sensors and the picture on the screen swipes in the same direction,
http://www.amazon.com/Make-Embedded-Projects-Hardware-Discovery/dp/1449389716
now i can figure out the software part on my own i just cant get my head around how to sense the swiping ,

perhaps if i line my sensors in this order      -5-4-3-2-1 2 34 5  and then if sensor one senses something then check if sensor 2 sensed something if not then check sensor -2 to see if it was in the other direction??

or maybe every time a sensor is activated enter a value into an array and then check the array for the order of the values and given a certain order i will know which direction the swipe was, i would have to have my sensor very nicely spaced out so i dont accidently activate one and get an awkward order of readings...
Example:


sensor[1]   sensor[2]     sensor[3]   sensor[4]   sensor[5]   sensor[6]  

as each one gets activated they store a value in an array lets use the number i provided for example,
so if i get 1,2,3,4,5,6 then the swipe was from left to right and vice versa...make sense? feasible? or am i way off here?
better way?
232  Using Arduino / Project Guidance / Re: Is My Project Feasible? on: July 17, 2011, 05:10:23 am
you might also want to brush up on multiplexing
233  Using Arduino / Programming Questions / Re: accelerometer give bad reading when VirtualWire is on. on: July 15, 2011, 02:45:05 am
okay well i did a little workaround i guess even though it still wont give me as accurate readings as it does without virtualWire enabled
its close enough with an average of -2 when i other wise get a 0 without VW activated.

all i did was move the 2 lines to the bottom and acitvated VW  AFTER getting my readings and then drop the baud rate of VW back to 0 before the loop runs again so it does not
mess up my readings. I would use a deactivate function but i dont see one in the VW documentation so setting the baud rate to 0 will do.

Code:
void loop() {
 
 
  // variables to read the pulse widths:
  int pulseX, pulseY;
  // variables to contain the resulting accelerations
  int accelerationX, accelerationY;
 
  // read pulse from x- and y-axes:
  pulseX = pulseIn(xPin,HIGH); 
  pulseY = pulseIn(yPin,HIGH);
 
 
  accelerationX = ((pulseX / 10) - 500) * 8;
  accelerationY = ((pulseY / 10) - 500) * 8;
 
   accelerationX = map(accelerationX,0 ,1023,0,255);
   accelerationY = map( accelerationY,0,1023,0,255);

 
   coordinates[0] = accelerationX;
 
  coordinates[1] = accelerationY;
// Serial.println(coordinates[0]);   // up to this point everything works fine and i get good readings but if i were to uncomment anything
                                   //initializing virtualwire then my readings are off..
 
 vw_set_ptt_inverted(true);  //this i would normally put it in the setup function but since it was causing problems it is here now
 vw_setup(2000);
 vw_send( (uint8_t *)coordinates, sizeof(coordinates));
 vw_wait_tx();
  delay(50);
   vw_setup(0); // and since  i cannot find a "deactivate" function for virtualwires transmitting end then this will have to do the trick.
 
 
 
 
 
 
}
234  Using Arduino / Programming Questions / accelerometer give bad reading when VirtualWire is on. on: July 15, 2011, 02:08:17 am
okay so  i have one of those mesmic accelerometers and when testing it with the arduino sample code it works fine,
then i only thing i have changed is mapped the values it gives me to 0-255 as you will see in the code,
then i want to send that through my RF links
and the sending works all my wiring is correct but when i start my Serial to debug , i get a reading of -188 when it should be 0 or close to it,
and when  i comment out the virtual wire code , i get good readings.  So i thought maybe it had something to do with having serial running at 9600 and virtualwire doing its thing at 2000 buad rate , so  i commented out my serial.begin statement and compiled and went ahead and got my other  arduino with the reciever and i still go the -188 values...
oh and ive loaded the values into an array since virtualwire sends strings
but that part of the code all works fine because if  i print the values in the array they are acurate its just when i have VW on that  i get it wrong

Code:
const int xPin = 2; // X output of the accelerometer
const int yPin = 3; // Y output of the accelerometer

#include <VirtualWire.h>
int coordinates[2];                 //must make an array to send intergers through virtualwire
void setup() {
  // initialize serial communications:
  Serial.begin(9600);
  //vw_set_ptt_inverted(true); // if i uncomment this and the following line my readings are off , way off. and i do not understand why
 // vw_setup(2000);
  // initialize the pins connected to the accelerometer
  // as inputs:
  pinMode(xPin, INPUT);
  pinMode(yPin, INPUT);
 
}

void loop() {
 
 
  // variables to read the pulse widths:
  int pulseX, pulseY;
  // variables to contain the resulting accelerations
  int accelerationX, accelerationY;
 
  // read pulse from x- and y-axes:
  pulseX = pulseIn(xPin,HIGH); 
  pulseY = pulseIn(yPin,HIGH);
 
 
  accelerationX = ((pulseX / 10) - 500) * 8;
  accelerationY = ((pulseY / 10) - 500) * 8;
 
   accelerationX = map(accelerationX,0 ,1050,0,255);
   accelerationY = map( accelerationY,0,1050,0,255);
 
 
   coordinates[0] = accelerationX;
 
  coordinates[1] = accelerationY;
 Serial.println(coordinates[0]);   // up to this point everything works fine and i get good readings but if i were to uncomment anything
                                   //initializing virtualwire then my readings are off..
 //vw_send( (uint8_t *)coordinates, sizeof(coordinates));
// vw_wait_tx();
  delay(100);
 
 
 
 
 
 
}
235  Topics / Education and Teaching / MIT (Massachusetts Institute of technology) OpenCourseWare on: July 14, 2011, 04:45:59 am
not sure if this has been posted before but this is a nice website by MIT
basically its free notes and lecture on an array of subjects including electrical engineering and computer science
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-002-circuits-and-electronics-spring-2007/video-lectures/lecture-1/
236  Using Arduino / Microcontrollers / Re: using an arduino to burn bootloader. on: July 14, 2011, 03:41:00 am
here ya go http://arduino.cc/en/Tutorial/ArduinoISP
237  Using Arduino / General Electronics / Re: PNP transistors... how to use them? on: July 06, 2011, 05:06:30 am
never heard that in my 24  years hahaha but now i understand why he would marry my mothers sister.
238  Using Arduino / General Electronics / Re: PNP transistors... how to use them? on: July 06, 2011, 04:57:21 am
haha thanks for the insight!

like you said , Cheers!

(i didnt get the Bob reference) 
239  Using Arduino / General Electronics / Re: PNP transistors... how to use them? on: July 06, 2011, 04:48:16 am
LOL i do have all those in place sir , i posted that for times sake i just did not draw them in , but the smoke is at bay! and connecting the resistor to 12v in fact shuts it off
240  Using Arduino / General Electronics / Re: PNP transistors... how to use them? on: July 06, 2011, 04:43:20 am
the magic smoke reminds me of that show Lost.
Pages: 1 ... 14 15 [16] 17 18