Show Posts
Pages: 1 ... 2249 2250 [2251] 2252 2253 ... 3271
33751  Using Arduino / Programming Questions / Re: keypad brainfart on: October 27, 2011, 10:38:33 am
  char key = keypad.getKey();                 // reading the keypad
Declares a local variable named key and values it.

void whichkey (){
     Serial.println("whichkey routine");
   Serial.println(key, HEX );
Prints the value of the global variable named key.

They are NOT the same variable.
33752  Using Arduino / Programming Questions / Re: C++ code on: October 27, 2011, 10:18:15 am
but when I connect my arduino board using USB cable(COM6) the code
does not return the right HANDLE to use for sending and recieving datas,
I don't see any error but can't recieve the correct datas (it recieve a constant number)
How do you know that the program is not returning the correct HANDLE?

What code is running on the Arduino?

What do you see in your application?

Feel free to volunteer any other data that would help us solve your problem.
33753  Using Arduino / Programming Questions / Re: Displaying Received serial data on: October 27, 2011, 10:14:42 am
how to recode it so it returns the letter I send
The Serial class derives from the Print class. The Print::print() method has several overloads, to print different kinds of data. You are using int overload (because you call the function with an int) and expecting the function to print a char. You need to either store the value returned by in the appropriate type variable (char), or cast the int to a char when printing.

As far as the off-by-one issue, you need to tell us more about this:
I wanted to send a character from a terminal program on the  PC
Which terminal program? How is the serial communication configured?

Try using the Serial Monitor, to see if the problem manifests itself there, too.
33754  Using Arduino / Networking, Protocols, and Devices / Re: Difference between USB Modem and USB Dongle on: October 27, 2011, 08:40:04 am
P.S. I'm trying to achieve a range of about 100 metres as well.
I think you need to look at the specs for bluetooth. Most bluetooth devices are class 2, with a limit of 10 meters.
33755  Using Arduino / Project Guidance / Re: android and enc28j60... on: October 27, 2011, 08:07:39 am
Down the road is the Ford dealer. Perhaps they can help you.

This here is the Arduino forum. If you have an Arduino question, ask it here.
33756  Using Arduino / Project Guidance / Re: feasability: android 2.1. and arduino usb on: October 27, 2011, 08:00:27 am
What would the Arduino be doing? Sitting on the sidelines watching?

ADK will work
What ADK?

I even could not connect enc28j60 to it
To what?

any other solution for a simple connection to command motors from Android please?
Use the Android to push some switches connected to the Arduino that's sitting over there doing nothing.
33757  Using Arduino / Project Guidance / Re: Plasma cutter - controlling height above cut workpiece - need help with code on: October 27, 2011, 07:55:27 am
There are no calls in the code to turn on the internal pullup resistors. This implies that you have external pullup or pulldown resistors. Do you? How ARE the switches wired?

You are not debouncing the buttons, except through the use of serial print statements. Not a good idea to rely on Serial.print() taking time.

You have code to increment or decrement the count when the hallValue is greater than 1, and apparently identical code for when hallValue is less than 2.

Why does the up/down stuff depend on hallValue?
33758  Using Arduino / Project Guidance / Re: light control unit code problems on: October 27, 2011, 07:42:22 am
delay(1000); //turn all off for 1 second
delay() doesn't turn anything on or off.

Do you suppose automobiles are assembled by piling all the parts around the edge of the room, and put together as they are encountered? No. The engine is put together. The transmission is put together.

You should be writing code the same way. Write a sketch that does nothing more than a Serial print when a switch is pressed. When that works, expand on that to print another message when the switch is released. When that works, expand on that to print only once when the switch transitions from released to pressed, and once when the switch transitions from pressed to released.

When that works, you know your switches are wired correctly, and that you understand how to read them and how if statements work.

You know none of that now. Assuming the switches work has you looking at the software for problems that may be hardware issues.

There are no statements to enable the internal pullup resistors, so you need external pullup or pulldown resistors. Do you have them? How ARE the switches wired?
33759  Using Arduino / Project Guidance / Re: Quick Pin Mapping Question on: October 27, 2011, 07:23:21 am
The numbering of the pins on the ATMEL chip does not correlate to the pin numbers around the edge of the Arduino.

Use the number around the edge of the Arduino.
33760  Using Arduino / Project Guidance / Re: MEGA 2560 Help wanted with coding on: October 27, 2011, 07:20:24 am
I am currently working my way through the examples but cant seem to find a particular way of sending data from a PC to the Adrunio which will switch on 8 digital outputs.
That's because you get to define what to send and what to do in reaction to that value/data/string appearing.

I would like to be able to send instruction as a Byte from the PC with some sort of identification attached which would be stripped from the data before being transmitted.
If you are going to strip off the ID, why send it?

Ideally I want the unit to serve my project using multiple comm send and receives for data aquisition.
You need to elaborate on this. What is "my project"? Does "using multiple comm send and receives" mean more than one connection to the PC, or does it mean doing the send/receive operation more than once?

How does sending a byte from the PC to the Arduino result in data acquisition?

Also i keep reading that i cant use pins 4 & 5 as they are dedicated to Serial Comms.
Take whatever you are reading this crap in to the nearest shredder.

Pins 0 and 1 are used by Serial. Other pins, clearly labeled on the board, are used by Serial1, Serial2, and Serial3. If you don't need those pins for those purposes, you can use the pins for other things.

Of course, if you want to communicate with the PC you HAVE to leave pins 0 and 1 alone.

Im using the Mega is this still true
I guess it is. You told us you are.

incidently the pin map starts at pin 1 not 0 WHY!
What pin map? If it's in the same material that says you can't use pins 4 and 5, it's rubbish.

the functions dont even coincide as pin 1 is a PWM pin?
What functions? Pin 1 is NOT a PWM pin.

and no not the famous Microsoft suggestion
Well, you do need to be smart enough to figure out what's rubbish and what's true. You're not doing too good, so far.

But, you are trying, and that's good.
33761  Community / Website and Forum / Re: incorrect image bug: arduino mega. on: October 27, 2011, 06:41:22 am
The pages used to show the front image only. Clicking the front image showed the back side. Now the page shows both the front and back, so clicking the ONE picture shows the back.

What did you expect it to show? Dancing girls?

If you claim that there is a problem, you should describe what you think the problem is.

clicking the mega 2560 front picture shows me the rear image.
This does not look like a statement of a problem.
33762  Using Arduino / Networking, Protocols, and Devices / Re: Multiple SMBus Temperature sensors on: October 27, 2011, 06:24:13 am
According to section 8.3.3 of the data sheet, the slave address is stored in EEPROM, at address 0x00E, and that that address is writable.

So, it would seem that you CAN assign a different slave address to a device.

Section 8.4.6 details what to send to the device to read/write specific values. Exactly what to write is up to you. Exactly how is left as an exercise for the student.
33763  Using Arduino / Networking, Protocols, and Devices / Re: wireless communication problem on: October 27, 2011, 05:45:02 am
Sensor 1 = 525548255
If you printed spaces between the values, you would see
Sensor 1 = 52 55 48 255
52 is the ASCII code for 4
55 is the ASCII code for 7
48 is the ASCII code for 0

Printing the values as characters, instead of integers, you would have seen
Sensor 1 = 470ΓΏ

Not printing data that wasn't there, you would have seen
Sensor 1 = 470
33764  Using Arduino / Networking, Protocols, and Devices / Re: Arduino parsing webcode not working? on: October 27, 2011, 05:32:43 am
oldvar1 = readvalues();
So, oldvar1 is the new value that just arrived?

Instead of var1 and oldvar1, give variables meaningful names, like pinState and phpState.

You have Serial.print(ln)() statements that print useless information. Why not add some that print useful information? Printing pinState after reading the pin state would be useful. Printing phpState after reading it from the connection would be useful. Serial.println("Comparing Server Status"); simply tells us that loop started. Well, we know that happens. A lot.

You are not enabling the internal pullup resistor for pin 2. This implies that you have an external pullup or pulldown resistor wired with the switch. Do you? How IS the switch wired?
33765  Using Arduino / Networking, Protocols, and Devices / Re: RF2400P low cost RF transceiver on: October 27, 2011, 05:02:33 am
I 'm not sure how to connect them to the arduino Uno
It says that it uses SPI to communicate. Connect power, ground, and the SPI pins (10 to 13). You get to look up which is which.

Do you think VirtualWire will work ?
No. VrtualWire is for I2C.
Pages: 1 ... 2249 2250 [2251] 2252 2253 ... 3271