Show Posts
Pages: 1 ... 2248 2249 [2250] 2251 2252 ... 3270
33736  Using Arduino / Programming Questions / Re: "simple" Arduino Brethalyzer Project MQ-3 on: October 27, 2011, 11:16:47 am
Quote
When I put some "simple"

digitalWrite(5,HIGH);
delay(1000);
digitalWrite(5,LOW);
delay(1000);
Code in the setup the LEDs are not very bright at all.
Before or after the pinMode() statements that declare the pins as output? Before would be my guess, based on the symptoms you describe. If that is the case, move them after the pinMode statements.
33737  Using Arduino / Programming Questions / Re: ROBOTC for Arduino on: October 27, 2011, 11:10:34 am
Quote
It's available and I have it.
Not going to share, huh?
33738  Using Arduino / Programming Questions / Re: Servo library? Servo ignoring my delays, the first time only on: October 27, 2011, 10:41:23 am
Quote
Sounds good.... why would anyone ever detach a servo?

I assumed I'd want to attach/detach them to save power?
I think you answered your own question. However, servos can drift when they are not powered. If that matters, you can't detach them.
33739  Using Arduino / Programming Questions / Re: keypad brainfart on: October 27, 2011, 10:38:33 am
Code:
  char key = keypad.getKey();                 // reading the keypad
Declares a local variable named key and values it.

Code:
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.
33740  Using Arduino / Programming Questions / Re: C++ code on: October 27, 2011, 10:18:15 am
Quote
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.
33741  Using Arduino / Programming Questions / Re: Displaying Received serial data on: October 27, 2011, 10:14:42 am
Quote
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 Serial.read() 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:
Quote
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.
33742  Using Arduino / Networking, Protocols, and Devices / Re: Difference between USB Modem and USB Dongle on: October 27, 2011, 08:40:04 am
Quote
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.
33743  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.
33744  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?

Quote
ADK will work
What ADK?

Quote
I even could not connect enc28j60 to it
To what?

Quote
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.
33745  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?
33746  Using Arduino / Project Guidance / Re: light control unit code problems on: October 27, 2011, 07:42:22 am
Quote
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?
33747  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.
33748  Using Arduino / Project Guidance / Re: MEGA 2560 Help wanted with coding on: October 27, 2011, 07:20:24 am
Quote
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.

Quote
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?

Quote
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?

Quote
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.

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

Quote
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.

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

Quote
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.
33749  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.

Quote
clicking the mega 2560 front picture shows me the rear image.
This does not look like a statement of a problem.
33750  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.
Pages: 1 ... 2248 2249 [2250] 2251 2252 ... 3270