Show Posts
Pages: 1 ... 47 48 [49] 50 51 ... 196
721  Using Arduino / Programming Questions / Re: byte mirror code don't work on: December 06, 2013, 10:44:07 pm
Quote
The most straight forward solution is a for loop calling bitRead() and bitWrite().
I agree, but for some reason my IDE Version 1.0.5 does not know what the bitWrite() function is, even after I reinstalled it.

So I made that mirror function like it is, (I did not Google it) and it seems to work rather well.

Added:
Strange thing, I just downloaded version 1.0.5 on my old Windows XP laptop, and the bitWrite function works, but the exact same sketch on my new windows 8 laptop, with the same IDE version does not compile. It says "bitWrite was not declared in this scope", So I copied the IDE from my XP laptop, to my Windows 8 laptop, and the bitWrite function now works.

I just reinstalled the IDE from the download page, and again it works. Maybe something just wasn't downloading correctly, the first 3 times.  smiley-sad But never the less it works now.
722  Using Arduino / Programming Questions / Re: Laptop control using Arduino on: December 06, 2013, 10:37:42 pm
Quote
Can it be done using Arduino UNO? Because I am not directly using any keyboard command. I am just receiving a serial value and then telling my computer to act on the basis of received value.
That, I can't say because I don't know if your computer/laptop will be able to receive serial commands when it is sleeping.
723  Using Arduino / Programming Questions / Re: Laptop control using Arduino on: December 06, 2013, 10:13:28 pm
You will need an Arduino Leonardo in order to do that. So far none of the other Arduino's can interface with keyboard commands, so if anything that's where you should start.
 
Now if your computer has a sleep and wake button, I would see if there is a way you can make hot-keys for them, or see if you can make the key combination yourself with the libraries available keys.

If you able to figure out the hot-key / key combination , then the next part should not be difficult to implement.
724  Using Arduino / Project Guidance / Re: Arduino Robot Arm controlled by Joystick on: December 06, 2013, 08:38:08 pm
The 5 pins on the joystick should be labeled. V+, GND, Y, X, Button/AUX. Something along those lines. You can put them into the breadboard, or if you have wires with male to female connectors on the ends, you can use those instead.
725  Using Arduino / Project Guidance / Re: Arduino UNO not receiving serial data(TX) from Bluetooth module on: December 06, 2013, 04:24:40 pm
See if you can get Bluetooth Chat, that program should know works.
726  Using Arduino / Programming Questions / Re: Traffic Light Controller Programming Code on: December 06, 2013, 03:58:49 pm
Get rid of all the delays functions, and look at the example sketch Blink without Delay. It will help you tremendously.
727  Using Arduino / Programming Questions / Re: Ultrasonic sensor mounted on a servo on: December 06, 2013, 03:56:58 pm
Try this, instead of using the using || use &&, this way the code knows to compare the ranges from Left AND Right, as opposed to Left OR Right.

See if that works, if not it could be another issue somewhere else.
728  Using Arduino / Programming Questions / Re: byte mirror code don't work on: December 06, 2013, 03:12:22 pm
Thanks
729  Using Arduino / Programming Questions / Re: byte mirror code don't work on: December 06, 2013, 03:03:59 pm
If it helps any, here is my solution.
Code:
byte Mirror(byte ary)
{
  byte h, l;
  byte table[16] = {
    0x0, 0x8, 0x4, 0xC,
    0x2, 0xA, 0x6, 0xE,
    0x1, 0x9, 0x5, 0xD,
    0x3, 0xB, 0x7, 0xF
  };
  h = table[ (ary & 0xf0) >> 4 ]; // Notice the closing bracket is different from the one below. This is because of the look up table is written as 0xN and not 0x0N
  l = table[ ary & 0x0f ] << 4;
  //Serial.println( l | h ,HEX);
  return (l | h );
}
730  Using Arduino / Project Guidance / Re: Arduino Robot Arm controlled by Joystick on: December 06, 2013, 01:30:57 pm
???
How else would you go about connecting the joystick to the servos? You can use a breadboard, unless you want to make your own PCB.

The codes ZoomKat provided work like this. If you press a button, the servo will move to a certain position, press another button and it will move to a different position.
731  Using Arduino / Project Guidance / Re: Arduino Robot Arm controlled by Joystick on: December 06, 2013, 01:02:20 pm
No don't use a Y-cable for any of the servos, that will not work the way you want it to.  Simply connect all five of the servos data pins to the Arduino's digital pins (2 - 6). The wires are usually color coded. Yellow or blue is usually the data pin, and red/ black or red/ brown are for the power. Red being positive.
732  Using Arduino / Project Guidance / Re: Arduino Robot Arm controlled by Joystick on: December 06, 2013, 12:47:41 pm
@ZoomKat:

He will be using the joystick to control the servos, not the buttons. The buttons will determine which servos will move. Do you have any sample codes along those lines?
733  Using Arduino / Project Guidance / Re: Arduino UNO not receiving serial data(TX) from Bluetooth module on: December 06, 2013, 12:41:37 pm
Have you tried it with Putty or any other terminal program other than the serial monitor? What program are you using on your phone?
734  Using Arduino / Project Guidance / Re: Arduino Robot Arm controlled by Joystick on: December 06, 2013, 12:29:20 pm
The servos will only give you about 5-6 inches of slack, so as in the video, you will need to make a lengthy cable of 5 or more wires. This will connect the joystick to the Arduino. As for the servos, you will need to have a power supply that can provide 6 volts! This will be enough to power the Arduino and the servos. Mainly the servos because they need 6 volts to work properly. Now if you use two different power supplies, you need to make sure the grounds are connected. (Look that up if needed)

That should be enough to give you some idea to start with.
735  Using Arduino / Project Guidance / Re: Arduino Robot Arm controlled by Joystick on: December 06, 2013, 12:03:29 pm
I got one better. It may seem a little over the top for you, but it is actually very simple.
Keep the one joystick, but in addition, use an accelerometer to control the Base and Arm. This way, the controls should be more fluid and the joystick will only be in charge of two functions instead of all three.
Pages: 1 ... 47 48 [49] 50 51 ... 196