Show Posts
Pages: 1 ... 51 52 [53] 54 55 ... 110
781  Using Arduino / Displays / Re: Nokia LCD display shield question on: December 30, 2012, 03:19:24 pm
with the gLCD library, are you using PHILLIPS or EPSON? If the former, then there are four options to choose from:
PHILLIPS_0
PHILLIPS_1
PHILLIPS_2
PHILLIPS_3
It is a case of trial and error as to which one produces the desired results.

If you have an EPSON display and it is mirrored, then you have come across a display I haven't seen before, in which case I would have to add a new definition into the library.
782  Using Arduino / Displays / Re: Nokia LCD display shield question on: December 30, 2012, 02:17:27 pm
Are you using their library (ColorLCDShield), or mine (gLCD)?
783  Using Arduino / Programming Questions / Re: check my first code pls on: December 29, 2012, 04:04:07 pm
You may want to check the values you are using for analog in.

If you assume a reference of 5V, and 1024 possible analog values, then you get:

value= 1024 * voltage / 5

If you allow around a +/-200mV from those points you get the following value ranges for your if statements:
Code:
2V = 408 ----->   368 to 451
3V = 614 ----->   573 to 656
4V = 819 ----->   778 to 860
784  Using Arduino / Microcontrollers / Re: Help in programming the Atmega1284 with maniacbug-mighty-1284p. on: December 29, 2012, 09:32:25 am
Could you post a picture of your circuit?
785  Using Arduino / Installation & Troubleshooting / Re: Duemilanove chip in an Uno on: December 29, 2012, 09:12:11 am

There are fake atmegas?
Yup, as Sparkfun found out in 2010 smiley. It makes for some interesting reading.

http://www.sparkfun.com/news/350
http://www.sparkfun.com/news/364
http://www.sparkfun.com/news/384
http://www.sparkfun.com/news/395
786  Using Arduino / Microcontrollers / Re: Help in programming the Atmega1284 with maniacbug-mighty-1284p. on: December 29, 2012, 08:48:52 am
You need to swap the RX and TX lines over if you are trying to use the built in FTDI chip. (RX means the 328p's RX pin, which means that is the FTDI's TX pin).
787  Using Arduino / Displays / Re: Free display on: December 29, 2012, 08:11:48 am
What country are you living in? If the UK, I could be tempted.
788  Using Arduino / Programming Questions / Re: check my first code pls on: December 29, 2012, 07:33:02 am
You will find that the way you have built your if-elseif statements won't work quite as you expect:
Code:
if (value >= 0) {
    //value is always greater than zero, so code always reaches here
    if (value <= 5) {
       ...
    }
} else if (value <= 209) {    //about 1 v
    //The first if statement is always true, therefore this bit of code never executes.
    if (value >= 200) {
       ...
    }
}

You are along the right lines though. You just need to consider what you are looking for. For the first if statement you want the value to be >=0 AND <= 5. So based on that you get this:
Code:
if ((value >= 0) && (value <= 5)) {
... //will execute if the value meets both conditions
} else if ((value >= 200) && (value <= 209)) {    //about 1 v
...
}



The problem of negative values however still remains. What you need to do is to take your +/-1v signal and add a bias so that it is within the range of the ADC.

There is one such method which uses just two equally sized resistors. I have attached a schematic.

What the circuit does is att 2.5v onto the signal meaning that when you have -1v, the ADC sees 1.5V, when you have +1v, the ADC sees 3.5v.

How successful this method will be depends on what is driving the +/-1V signal.
789  Using Arduino / Programming Questions / Re: check my first code pls on: December 29, 2012, 05:41:46 am
AnalogRead will never return a negative number. If you try and feed -1V into an analog pin you will damage the Arduino.

Secondly, there is always a margin for error with ADC's. The value will not reliably be 1000, for example it may be 997, 999, 1003 - You should allow a range of numbers to be included.

Next, where did 1000 come from? The analogRead value returns a number between 0 and 1023 which represent equal steps between 0v and AREF. If you are using the default reference voltage then 1023=5v, 0=0v, and approximately 204=1v.
790  Using Arduino / Programming Questions / Re: ATMEGA644 Serial1 can't work on: December 28, 2012, 01:20:19 pm
No the 644p does have two serial ports, the 644 just one.
I was counting the 'p' ones as a seperate series, but yeah the 644p has two.

catchup, do you have the Atmega644p or the atmega644?
(note that the 'p' is not the same as 'pu', for example there are AtMega644P-PU and AtMega644-PU).
791  Development / Other Hardware Development / Re: Atmega64/128 support? on: December 28, 2012, 08:26:27 am
By the looks of things it should be a simple case of a new pins_arduino.h file and an additoinal entry in the boards.txt file.
792  Using Arduino / Programming Questions / Re: Read Unsigned Long from Serial on: December 28, 2012, 07:48:54 am
In which case:
Quote
Returns
 
int
(From here: http://arduino.cc/en/Reference/StreamParseInt)
Needs correcting.
793  Using Arduino / Project Guidance / Re: RFID reader received XXxxx 000 on: December 28, 2012, 07:19:35 am
Code:
Serial.begin(2400);

Look at the bottom right of the arduino Serial Monitor, and tell me what is wrong  smiley.
794  Using Arduino / Programming Questions / Re: ATMEGA644 Serial1 can't work on: December 28, 2012, 06:48:20 am
Yup, only the larger AtMega1284 from that series has two UARTs.
795  Using Arduino / Programming Questions / Re: Read Unsigned Long from Serial on: December 28, 2012, 05:12:26 am
parseInt may look for a long, but according to its arduino page it returns an int as the op said.

For unsigned, you can use the unsigned version of strtol, called 'strtoul'
http://www.cplusplus.com/reference/cstdlib/strtoul/

Example usage:
Code:
  unsigned long ul = strtoul(inputString,NULL,base);
Pages: 1 ... 51 52 [53] 54 55 ... 110