Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / General Electronics / Re: Using Relays or FET's to turn on extra capacitance on: July 23, 2013, 08:35:36 pm
Here was the part I was planning on using

https://www.sparkfun.com/datasheets/Components/General/RFP30N06LE.pdf

Thanks!
2  Using Arduino / General Electronics / Using Relays or FET's to turn on extra capacitance on: July 23, 2013, 12:09:31 pm
Greetings,

I have a situation where I need to add some extra Capacitance that needs to sometimes be added to a RC discharge circuit. There is 48 volts on the rails with extra capacitance controlled currently with two relays. Relays need current that drains the system. they are two small 12 volt relays but they still use current. would it be practical to use Higher current FET's instead of relays? I could control them with one of the Arduino processors. My biggest fear is that the FETs will have a small amount of resistance making the capacitors drain slower and hosing the system up. Any thoughts??

Circuit is attached

Thanks
3  Using Arduino / Programming Questions / Re: Every function not declared all of the sudden on: July 11, 2013, 07:20:46 pm
The examples in the bounce library cause errors as well.....
4  Using Arduino / Programming Questions / Every function not declared all of the sudden on: July 11, 2013, 07:16:02 pm
I realized I forgot to give one of my functions LCDPrint a data type of 'int' for my variables. as soon as I did that is stopped recognzing EVERY single function in the script. Can anyone tell me how this happened

Code:
#include <Bounce.h>


#define debug
#define maxMenus 20
#define upButton  13
#define enterButton  12
#define downButton  11
#define motorOutFwd  9
#define motorOutbwd  10

#define C2Switch  7
#define C3Switch  6
#define motorInFwd  5
#define motorInBwk  4
#define motorAdjOne  3
#define motorAdjTwo  2


Bounce bouncerUp = Bounce( upButton, 10);
Bounce bouncerEnter = Bounce( enterButton, 10);
Bounce bouncerDown = Bounce( downButton, 10);



void setup() {

 
  pinMode(upButton, INPUT);
  pinMode(enterButton, INPUT);
  pinMode(downButton, INPUT);
 
 
  Serial.begin(9600);
  backlightOn();
}

void loop() {
  int menuScreen = 0; // Setup Menu Screen
 
  //update the debouncer
  bouncerUp.update ( );
  bouncerEnter.update ( );
  bouncerDown.update ( );
   
  //Get value of buttons
  int valueUp = bouncerUp.read();
  int valueEnter = bouncerEnter.read();
  int valueDown = bouncerDown.read();
 
 
 //get default value assigned to menuScreen
  if(menuScreen == 0){
    menuScreen = 1;
  }
  else{
    menuScreen = menuScreen;
    }
   
   
    if(valueUp == HIGH){
      if (menuScreen > maxMenus){
        menuScreen = 1;
        LCDPrint(menuScreen);
      }
      else{
        menuScreen++;
      }
    }// End up if statement
    if(valueDown == HIGH){
      if(menuScreen == 0){
        menuScreen = (maxMenus -1);
      }
      else{
        menuScreen --;
      }
    }//end if
     
     
    }   
   

void LCDPrint(int menuScreen){
  switch (menuScreen){
    case 1: 
      selectLineOne();
      Serial.println("one");
      break;
    case 2: 
      selectLineOne();
      Serial.println("two");
      break;
    case 3: 
      selectLineOne();
      Serial.println("three");
      break;
    case 4: 
      selectLineOne();
      Serial.println("four");
      break;
    case 5: 
      selectLineOne();
      Serial.println("five");
      break;
    case 6: 
      selectLineOne();
      Serial.println("six");
      break;
    case 7: 
      selectLineOne();
      Serial.println("seven");
      break;
    case 8: 
      selectLineOne();
      Serial.println("eight");
      break;
    case 9: 
      selectLineOne();
      Serial.println("nine");
      break;
    case 10: 
      selectLineOne();
      Serial.println("ten");
      break;
    case 11: 
      selectLineOne();
      Serial.println("eleven");
      break;
    case 12: 
      selectLineOne();
      Serial.println("twelve");
      break;
    case 13: 
      selectLineOne();
      Serial.println("thirteen");
      break;
    case 14: 
      selectLineOne();
      Serial.println("fourteen");
      break;
    case 15: 
      selectLineOne();
      Serial.println("fifteen");
      break;
    case 16: 
      selectLineOne();
      Serial.println("sixteen");
      break;
    case 17: 
      selectLineOne();
      Serial.println("seventeen");
      break;
    case 18: 
      selectLineOne();
      Serial.println("eighteenteen");
      break;
    case 19: 
      selectLineOne();
      Serial.println("nineteen");
      break;
    case 20: 
      selectLineOne();
      Serial.println("twenty");
      break;
    default:
      break;
  }// end case   
     
     
   
   
 
}//end LCD function


void MotorOutput(){
}


void selectLineOne(){  //puts the cursor at line 0 char 0.
   Serial.write(0xFE);   //command flag
   Serial.write(128);    //position
   delay(10);
}
void selectLineTwo(){  //puts the cursor at line 0 char 0.
   Serial.write(0xFE);   //command flag
   Serial.write(192);    //position
   delay(10);
}

void goTo(int position) { //position = line 1: 0-15, line 2: 16-31, 31+ defaults back to 0
if (position<16){ Serial.write(0xFE);   //command flag
              Serial.write((position+128));    //position
}else if (position<32){Serial.write(0xFE);   //command flag
              Serial.write((position+48+128));    //position
} else { goTo(0); }
   delay(10);
}

void clearLCD(){
   Serial.write(0xFE);   //command flag
   Serial.write(0x01);   //clear command.
   delay(10);
}
void backlightOn(){  //turns on the backlight
    Serial.write(0x7C);   //command flag for backlight stuff
    Serial.write(157);    //light level.
   delay(10);
}
void backlightOff(){  //turns off the backlight
    Serial.write(0x7C);   //command flag for backlight stuff
    Serial.write(128);     //light level for off.
   delay(10);
}
void serCommand(){   //a general function to call the command flag for issuing all other commands   
  Serial.write(0xFE);
}
5  Using Arduino / Programming Questions / Re: multiple interrupts for 3 button LCD screen on: July 10, 2013, 09:27:31 am
I believe it is. I'd also like to figure out how to use them. I believe it is good practice to use them

Thanks
6  Using Arduino / Programming Questions / Re: multiple interrupts for 3 button LCD screen on: July 10, 2013, 07:28:31 am
I am using three distinct pins to accomplish this but I want to use an interrupt to free up processing time so I am not continuously polling the three bits that are used for the button. I want it to go off and do what I really need it to do and only when any one of the three bits is pressed do I want it to address the buttons.

Thanks
7  Using Arduino / Programming Questions / Re: How to convert String to unsigned char? on: July 09, 2013, 11:03:27 pm
Code:
string FileMeasure="Hello FILE!"
int TempNumOne=sizeof(FileMeasure)
char Filename[100];
for (int a=0;a<=TempNumOne;a++)
        {
            Filename[a]=FileMeasure[a];
        }
8  Using Arduino / Programming Questions / multiple interrupts for 3 button LCD screen on: July 09, 2013, 10:58:36 pm
I am using an older Duemilanove for a project and would like to use three buttons for an LCD menu hooked up to an interrupt. Do I need three interrupts or one? How would I do this?

Thanks
9  Using Arduino / Project Guidance / Re: Power supply opto relay on: May 19, 2013, 10:12:04 am
The Arduino needs about 5-9 volts of DC power at about 50mA with a large safety factor you should be able to find a wall wart that supplies a minimum of 500mA depending on your opto boards. But since I do not see any schematics it's hard to tell. you can just as easily attach a male barrel jack onto the wall wart and use that to provide power.
10  Using Arduino / Project Guidance / Re: ROTARY ENCODER CODE... on: May 19, 2013, 12:09:49 am
It's easy, use the mills() function and count to 12,100,1024 etc however many counts per rotation the encoder is and save the number of mills() in a long variable. rotate it 360 again and subtract the two millis() and you  will get the time it took to complete one rotation.

11  Using Arduino / Project Guidance / 6 amp bipolar stepper motor driver on: May 18, 2013, 01:06:20 pm
What would be the most inexpensive way to drive several 6 amp 1.8 volt DC stepper motors with an Arduino?

Thanks
12  Using Arduino / Programming Questions / Re: Ports on the Arduino Mega Pins 22-53 on: April 22, 2013, 09:02:32 pm
Lefty,

I don't understand the spreadsheet I cannot find digital pins 22-53 on it.

Thanks

Bill
13  Using Arduino / Programming Questions / Ports on the Arduino Mega Pins 22-53 on: April 22, 2013, 05:25:50 pm
I need to turn digital pins 22-53 on the mega 2560 on and off really (really) fast. No inputs being processed just switching on Mux's how do I manipulate the ports to do this? I cannot find a good example.

Thank you
14  Using Arduino / Programming Questions / Re: array average on: April 22, 2013, 05:01:10 pm

float runningTotal = 0;
float average = 0;
for (int x = 0; x< 100; x++)
  {
   
    adcValue1= analogRead(phototransistorPin1);
    runningTotal = adcValue1 + runningTotal;
    adcValue2= analogRead(phototransistorPin2);
    runningTotal = adcValue1 + runningTotal;
    adcValue3= analogRead(phototransistorPin3);
    runningTotal = adcValue1 + runningTotal;
    adcValue4= analogRead(phototransistorPin4);
     
   average = runningTotal/x;
   
  }
15  Using Arduino / Displays / bitmap on 2.8" TFT touchscreen using memory alone on: April 22, 2013, 04:53:37 pm
I am using a mega 2560 with the 2.8" TFT touchscreen available on ADAFRUIT. I have 200,000 bytes left on the processor memory. Can I use this to display a bitmap image without using a scan disc card? If so how?

Thanks
Pages: [1] 2 3 ... 6