Show Posts
Pages: 1 ... 33 34 [35] 36 37 ... 44
511  Using Arduino / Audio / Using the Tone() function on: March 12, 2011, 08:01:33 pm
I am planning to use the Tone() function to give a short 5 note melody when an event is finished.  At the time I play the melody, there won't be anything else happening in my code.  But at other times my code DOES use millis() and PWM.  Are millis() and PWM only affected at the actual time I'm using the Tone() fucntion, or all the time? 


Quote
ATmega8: 2 (timers 2, and 1)
ATmega168/328: 3 (timers 2, 1, and 0)
ATmega1280: 6 (timers 2, 3, 4, 5, 1, 0)
The timer order given above is the order in which the timers are allocated. Timer 0 is a sensitive timer on the Arduino since it provides millis() and PWM functionality
512  Using Arduino / Displays / Re: shiftreg alternate IC on: March 12, 2011, 05:04:39 pm
I ended up using this to get my LCD working with the  SRLCD library and that SparkFun IC, 74HC595.
http://arduino.cc/forum/index.php/topic,15364.msg112755.html#msg112755
513  Using Arduino / General Electronics / Re: vias on homemade pcb on: March 10, 2011, 11:03:41 am
Ah yeah, the best idea may be not to do the plated through hole at all, but just put a via right next to the IC when needed.
thanks,
514  Using Arduino / General Electronics / vias on homemade pcb on: March 10, 2011, 09:04:44 am
Using an IC socket is a nightmare when traces are on the top side of the board, under the IC and you try to use a socket. I read this:
Quote
or buy the little pins made for the purpose (called 'vias')
...but have searched and searched to buy something called vias and can't find anything.  Is there such a thing?
515  Using Arduino / Sensors / using interrupt and the pull up resistor on the same pin on: March 09, 2011, 11:23:41 pm
Can I use the internal pull-up resistor with an attachInterrupt at the same time on the same pin?


Code:
attachInterrupt(0, CountPulse, RISING);//turn on interrupt for flow sensor on pin 2
digitalWrite(2, HIGH);  //turn on pull up resistor for flow sensor on pin 2

Will this do away with the need of the 10K resistor in the example for this sensor:
http://www.seeedstudio.com/forum/viewtopic.php?f=4&t=989&start=0
thanks!
516  Using Arduino / Displays / LCD in Sleep mode showing zzz's on: March 09, 2011, 10:27:47 pm
Trying to figure this out, I got so tired of zzz's remaining on the screen from previous print calls, I just did this:
I'd be much obliged if someone could shorten this code up a bit!
Code:
void Hibernate(){
  /*
  Sleep mode, shows sleeping zzz's, rising and falling across the screen
  waits for keypress to awaken
  */
  srlcd.clear();  //clear screen and set cursor at home
  while(key == NO_KEY){
    srlcd.clear();
    srlcd.print("Z");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("ZZ");
    key = keypad.getKey();
    delay(100);
    srlcd.clear();
    srlcd.print("Z");
    key = keypad.getKey();
    delay(100);
   
    delay(2000);  //breathe pause
   }
  Restart_Standby(); //reset display message for hibernate exit 
}
517  Using Arduino / Displays / Re: Shiftreg alternate IC for SRLCD on: March 09, 2011, 01:32:49 am
Quote
but this 595 has a latch pin that's not even mentioned in the SRLCD
That's because the shiftregister used with the SRLCD (arduinoshiftreglcd) doesn't have a latch, it's a somewhat simpler shiftregister. The outputs reflects the data as they are shifted in directly. The '595 however can retain the old output while new data are shifted in, until a latch pulse is given.

However Nadir have a nice solution here, although it only works with the three-wire method: http://arduino.cc/forum/index.php/topic,15364.msg112755.html#msg112755
Notice the enablepin is also connected to pin 12 on the 74HC595 as well as pin 6 (enable) on the LCD.

Thanks!  This looks like the answer...
518  Using Arduino / Displays / Re: Shiftreg alternate IC for SRLCD on: March 08, 2011, 11:05:48 pm
I've looked at that, but this 595 has a latch pin that's not even mentioned in the SRLCD.  I'd like to wire it up so I can use the SRLCD.h library to simplify my LCD.
519  Using Arduino / Displays / Shiftreg alternate IC for SRLCD on: March 08, 2011, 10:52:36 pm
I'm having trouble figuring out the pinouts, I have sparkfun's shift register, (74HC595) instead of the (74LS164) Can someone please explain the pins to me, they are called different things in the data sheets.
I know Qa-Qh is the same as Q0-Q7
But the 74LS164 in the SRLCD tutorial has an A,B CLK, and CLR, that I'm not sure what they are on the 74HC595.  Then the 74HC595 has 2 extra pins (it's a 16 pin, instead of 14 pin), I'm not sure which ones I need to ground or give 5+.
Thanks,
here's the SRLCD page:
http://code.google.com/p/arduinoshiftreglcd/
and sparkfun's 74HC595 datasheet:
http://www.sparkfun.com/datasheets/IC/SN74HC595.pdf
and the 74LS164 datasheet:
http://focus.ti.com/lit/ds/symlink/sn74ls164.pdf
520  Community / Gigs and Collaborations / Need a port of LCDBarGraph to SRLCD on: March 08, 2011, 08:17:01 pm
I talked with the maker of the nice utility 'LCDBarGraph', and he said:
Quote
Theoreticaly it is possible, however I do not have the time to port the LcdBarGraph to arduinoshiftreglcd.
But feel free to make the port! You only need to find replacements to the functions I use from the LiquidCrystal library. And don't forget to publish your work smiley Cheers,

I doubt it's very hard, but it's way beyond my scope.  If someone would care to do so, I'd sure use it...
521  Using Arduino / Displays / Re: using LCD bargraph with SRLCD on: March 08, 2011, 09:08:46 am
http://arduino.cc/playground/Code/LcdBarGraph
http://code.google.com/p/arduinoshiftreglcd/
To use both of these, would the bargraph.h library have to be editted to make it work with srlcd.h, instead of liquidcrystal.h?
It looks over my head.
522  Using Arduino / Storage / eeprom settings with default on: March 08, 2011, 12:14:53 am
In the code below, how do I add a default value, so that if the settings are deleted from eeprom, a default value will be given?  I want these default values:
MySettings.lightLevel = 800
MySettings.motor_delay = 40

Code:
struct config_settings {
    int mySensVals[12];  //# of pulses in 2-12 cups
    int motor_delay;     //change the distance the platform travels
    int lightLevel;         //photocell trigger level
    boolean Enable_Audio;  //whether the user wants sound
    boolean Enable_Piezo;  //whether the user wants a knock sensor
    boolean Enable_PhotoCell;  //whether the user wants to use the photocell
} MySettings;

void LoadSettings(){
  EEPROM_readAnything(0, MySettings);   //load the settings
}

void SaveSettings(){
  EEPROM_writeAnything(0, MySettings);  //save the settings
}
523  Using Arduino / Displays / using LCD bargraph with SRLCD on: March 07, 2011, 05:42:18 pm

I've tested each one of these alone, but don't know how to use both...
I want to use these two things:
http://arduino.cc/playground/Code/LcdBarGraph
http://code.google.com/p/arduinoshiftreglcd/

I tried changing this:
Code:
LcdBarGraph lbg(&lcd, DISPLAY_WIDTH);  //LCD Bargraph
to this:
Code:
LcdBarGraph lbg(&srlcd, DISPLAY_WIDTH);  //LCD Bargraph

...with no luck.
??? 
524  Using Arduino / Programming Questions / Re: How to get length of char* string on: March 05, 2011, 10:42:05 pm
Thanks!  I've read thru the reference section listing all the functions and things I can use in this arduino language, but strlen wasn't listed in there.  Is there a complete list of functions I can use in the arduino IDE, or is that reference section pretty complete?
525  Using Arduino / Programming Questions / How to get length of char* string on: March 03, 2011, 10:38:56 pm
In the below code, I have to count the length of the string and put it in hard code.  How can I programmatically do this?  I'm only familiar with string.length(), which is different than char string...

Code:
const char* MESSAGE = "Hello World";
const int MESSAGE_LENGTH = 11;
Pages: 1 ... 33 34 [35] 36 37 ... 44