Show Posts
Pages: 1 ... 347 348 [349] 350 351 ... 520
5221  Using Arduino / Programming Questions / Re: millis madness on: July 30, 2011, 10:00:04 pm
I am trying to build a simple on delay timer. I would like to press and hold a pushbutton for 5 seconds and then a LED would come on.

And? (hint: anything wrong?)
5222  Using Arduino / Displays / Re: Float significant digits on LCD display on: July 30, 2011, 09:57:54 pm
Think this should work, 2 digits is the default.
Code:
float f = 12.3456;
byte digits = 1;
lcd.print(f, digits);



Are you sure this will work? The ref. page says no but maybe it's old.

http://arduino.cc/en/Reference/LiquidCrystalPrint
5223  Community / Bar Sport / Re: Today is Faraday! on: July 30, 2011, 04:19:50 pm
And I thought it was Fryday

(Futurama's new name for Saturday smiley-razz )

That is Thursday for me on comedy channel.
5224  Using Arduino / Project Guidance / Re: Three voltage measurements + output to a LCD screen on: July 30, 2011, 04:18:25 pm
As far as I know you don't pull up or down an analog signal. You change the signal if you pull it to 5V.
5225  Using Arduino / Displays / Re: A strange 16 X 1 on: July 30, 2011, 10:48:04 am
Measure the distance between the two farthest holes and see if you get 38mm. From the picture I suspect it is 2mm spacing.
5226  Using Arduino / Displays / Re: Blink one line on 16x2 display on: July 30, 2011, 10:41:59 am
That's pretty impressive. Is that part of your library?
Thanks. I didn't make any library. It is as of now just a complete project code. You are welcome to use the code.
5227  Using Arduino / Displays / Re: Blink one line on 16x2 display on: July 30, 2011, 10:38:38 am
Quote
The LCD memory is not changed, but the custom character memory is changed instead.
You are just using substituting one of the LCD memory locations for another.  You are using CGRAM (Character Generator RAM) to define your custom character data instead of getting the regular data out of CGROM (Character Generator ROM).  In either case the data is copied to DDRAM (Display Data RAM) and displayed on the screen.

Don

Yes Don. That was exactly what I suggested. I guess I was changing DDRAM after all.
5228  Using Arduino / Displays / Re: Blink one line on 16x2 display on: July 29, 2011, 11:45:53 pm
But your example is EXACTLY identical to writing "A" and then writing " " (blank).  Except, of course, that you don't have to fool around defining characters.

I could make a bunch of A's for an animation of an A scrolling up. smiley-wink
Apparently this can be done on as many as 8 unique characters and a long of free time to kill. smiley-wink

Like this one, except you will be animating a character instead of arrow.

http://liudr.wordpress.com/2011/03/08/arduino-character-art-on-lcd/
5229  Using Arduino / Displays / Re: Blink one line on 16x2 display on: July 29, 2011, 10:34:40 pm
Quote
Then customize these 6 characters to look like "Active", then customize them to look like "      ".
I don't quite follow you but it looks like you are rewriting the memory contents one way or another.  I think he wants to leave the memory contents the same and just turn the display of them on and off which can't be done using the inherent instructions.  The closest you could get is to shift them horizontally out of view, but this would shift the other line as well.

Don

Here is what I mean:

Let's say the OP wants to display A (Active is too long as example) and blink it by displaying space over A then display A again to form a blinking A. OP needs to repeatedly print to the same cursor position with A, then space, then a, ...

My solution is to print custom character 0 where A should be. Then define the custom character to look like a, say with this array
byte custom_0_A[]={4,10, 17,17,63,17,17,0};

The above looks like A.

Then the OP redefine the same character as:
byte custom_0_space[]={0,0,0,0,0,0,0};

By sending this new definition, the A is erased.

Then the OP can repeat, define char 0 as custom_0_A, then define it as custom_0_space. The LCD memory is not changed, but the custom character memory is changed instead. The OP can also decide to define char 0 as:
byte custom_0_half_A[]=(0,0,0,4,10,17,17};
etc. and could animate this cell.

I'll pull out my arduino from my suitcase and hopefully give a demo.
5230  Using Arduino / Displays / Re: Housing for LCD with buttons? on: July 29, 2011, 10:26:02 pm
Jan,

I have seen LCD with buttons a while back. If by that you meant LCD module and a few buttons all on the same circuit board. Someone asked a while back about a 20X4 serial LCD and I followed his link and found a whole bunch of LCDs of different types some with buttons (4 direction, a yes and a no).

If you can settle with a few keys and an LCD that can be assembled on a PCB, you can check out several LCD shields that different people made. I make a couple models myself. Just click the phi-2 shield link on my signature with the long stripe of pictures smiley

As for housing, do you mean some sort of box or handheld device enclosure that will reveal an LCD and buttons? Google box enclosures you can find some but frankly I looked at many of their dimensions and the don't even fit a basic 16x2 display on their windows. I gave up and made my own in two ways:
1) customize a sheet of acrylic online (I went to ponoko) to cut out a window for LCD and a few holes for buttons.
2) but an enclosure large enough, cut your own window with a power tool like Dremel. Very tedious and long for me.

Read my short story of my "journey" to make an enclosure for my project:

http://liudr.wordpress.com/2011/01/10/make-an-enclosure-or-face-plate-for-your-arduino-projects/
5231  Using Arduino / Displays / Re: A strange 16 X 1 on: July 29, 2011, 10:14:11 pm
What parts do you want to fit the headers on? (did you mean header?)
5232  Using Arduino / Displays / Re: Blink one line on 16x2 display on: July 29, 2011, 10:12:48 pm
Don,
Just want to "challenge" your answer with a ridiculous answer that will do the job but is harder to do and at the same time offers more features if used properly.

Since the HD44780 display has 8 custom character spaces, one can print on second line 012345 (first 6 of the 8 custom characters). Then customize these 6 characters to look like "Active", then customize them to look like "      ". You can do other stuff too, such as rolling the "Active" up one pixel at a time in circular buffer or simply roll them out and start again. It's definitely not the easiest but may offer features the easy way doesn't offer smiley-wink

It's the old-school color palette trick.
5233  Using Arduino / Project Guidance / Re: Three voltage measurements + output to a LCD screen on: July 29, 2011, 09:05:57 pm
just playing around and as soon as I divide the input by 1023 I get a static display of 0v  smiley-confuse

Sorry I dropped the ball. I'm in a conference (arduino workshop two days from today and more on physics teaching!).

The reason you got zero was because you divided your reading by 1023. Both your analog reading and 1023 are integers so their division was handled as integer. Only quotient was reported, which is almost always 0, while the remainder is lost. Say you have 512 from analog input, you divide it by 1023. You get 0 as quotient and 512 as remainder but integer division only reports quotient, 0. Then any subsequent multiplication or division is zero.

You want to do this instead: result=analogRead(sensor)*5.00/1024;

The above way multiplies an integer (analogRead) with a float 5.00. The operation requires converting integer to float. Then the result is divided by an integer 1024, which also requires the integer be converted into floats. Dividing floats won't be as inaccurate as dividing integers so you will get the desired scaling effect you want. BTW, it should be 1024, although 1023 is almost as good. smiley-wink
5234  Using Arduino / Displays / Re: A strange 16 X 1 on: July 29, 2011, 01:00:33 am
$2 yes, definitely good buy. If you need to display more info, go for a 16X2 or 20X4 display. Here is a couple of shields I designed just in case you're interested;)

http://www.inmojo.com/store/liudr-arduino-and-physics-gadgets/item/phi-2-interactive-arduino-shield-2004/

http://www.inmojo.com/store/liudr-arduino-and-physics-gadgets/item/phi-2-interactive-shield-for-arduino/
5235  Using Arduino / Displays / Re: A strange 16 X 1 on: July 28, 2011, 10:47:06 pm
I think 16X1 display organizes it memory like a 8X2 display so the first 8 characters are line 1 and the next 8 are line 2.
Pages: 1 ... 347 348 [349] 350 351 ... 520