Loading...
  Show Posts
Pages: 1 2 [3] 4 5
31  Using Arduino / Programming Questions / Re: mcp23008 on: August 07, 2011, 12:10:30 pm
same error exept it now shows

In function 'void setup()':
error: 'WriteLCDByte' was not declared in this scope
32  Using Arduino / Programming Questions / Re: mcp23008 on: August 07, 2011, 10:43:48 am
the page sais it is a library
so the example (sketch is in the library)
when i remove the lcd write (moving cursor around the dislay)
i see nothing
the backlight turns on whyle uploading and that is it

so i have a library called LCDI2C4Bit
with LCDI2C4Bit.h
LCDI2C4Bit.cpp
(example) LCDI2C4Bit.pde
33  Using Arduino / Programming Questions / Re: mcp23008 on: August 07, 2011, 09:29:45 am
well this is the error

In function 'void setup()':
error: 'WriteLCD' was not declared in this scope

and the example script calls for the <LCDI2C4Bit.h>

http://www.arduino.cc/playground/Code/I2CPortExpanderAndLCDs


LCDI2C4Bit_pde.cpp: In function 'void setup()':
LCDI2C4Bit_pde:30: error: 'WriteLCD' was not declared in this scope

and when i remove it nothing happens
34  Using Arduino / Programming Questions / mcp23008 on: August 07, 2011, 07:35:38 am
I'm trying to get the LCD/i2c/port expander working as posted at arduinowebsite /playground/Code/I2CPortExpanderAndLCDs
but the sample code doesn't compile.  I get the following error:

In function 'void setup()':
error: 'WriteLCD' was not declared in this scope

I looked in the .cpp file and don't see a WriteLCD() function but there is a WriteLCDByte() function so I changed it to WriteLCDByte but that fails the same. 

Is this old code?  Am I missing something?  I added the .h and .cpp files to the hardware library and it is finding them.  Is there an easier solution?   Any help is very welcome.

this is asked bevore but is not solved
35  Using Arduino / Programming Questions / another question on: August 01, 2011, 11:21:10 pm
i have a device that controlls my car with a 8000 puls trigger and it works from 55-155 km/h
but when i drive i never go past 140 km/h

is there a way to make the arduino make an puls based on the input puls (normaly the puls that controls the devie)
that can controll my car with 8500 puls triggers instead of 8000 (more pulses mean that it starts earlyer and stops earlyer)

thank you
peter
36  Using Arduino / Programming Questions / Re: how to use the a6810 on: July 31, 2011, 12:09:27 pm
sooo i can use it like a 595
i can program 595
37  Using Arduino / Programming Questions / how to use the a6810 on: July 31, 2011, 07:31:28 am
how can i use the a6810
for a clock
with a vfd as a display
i already have a project but that is using a pic and i cant programs pic's
but if somone can help me adjust the code to be a clock or give me the way to program it
(like the way how the send the time in 00.00.00 format)
here
is the code/circut i want to use

http://uzzors2k.4hv.org/projectfiles/uvledbox/UV%20LED%20Developer%20Box.zip

it is from this site
http://uzzors2k.4hv.org/index.php?page=uvledbox
38  Forum 2005-2010 (read only) / Troubleshooting / Re: help me on: April 06, 2010, 11:27:48 am
well i cheat a little
when i need to use something

i copy it from bevor in my script
39  Forum 2005-2010 (read only) / Troubleshooting / Re: help me on: April 06, 2010, 10:29:23 am
I GOT IT YAY

i updated alll the code and the secematics

Code:

#include "Servo.h"

Servo gasservo; // create servo object to control a servo
Servo oilbypassservo; // create servo object to control a servo


// constants won't change. They're used here to
// set pin numbers:

int potPin = 0;                       // Analog pin 0 connected to the potentiometer
int dieselpumptransistorPin = 3;                // connected from digital pin 9 to the base of the transistor
int potValue = 0;                      // value returned from the potentiometer

const int switchthatstartsPin = 4;     // the number of the start button pin
const int keythatcontrollsallbuttonPin = 2;     // the number of the pushbutton pin
const int powerledpin =  12;      // the number of the LED pin
const int oilpumpledpin =  13;      // the number of the LED pin
const int propaneinjectionledpin =  11;      // the number of the LED pin
const int oilpumptransistorPin = 9;    // connected to the base of the transistor


// variables will change:

// switch is connected to pin 2
int buttonState = 0;         // variable for reading the keybutton status
int inputVariable1 = 0;     // oil pump check
int inputVariable2 = 0;     // start up check
int inputVariable3 = 0;     // diesel check
int inputVariable4 = 0;     // diesel pump check
int val;                        // variable for reading the pin status
int val2;                       // variable for reading the delayed/debounced status
int buttonState2 = 0;                // variable to hold the button state
int lightMode = 0;              // Is the light on or off?

void setup() {
  // Set the switch pin as input
  pinMode(switchthatstartsPin, INPUT);
  // initialize the LED pin as an output:
  pinMode(powerledpin, OUTPUT);
  pinMode(oilpumpledpin, OUTPUT);  
  pinMode(propaneinjectionledpin, OUTPUT);    
  // initialize the keybutton pin as an input:
  pinMode(keythatcontrollsallbuttonPin, INPUT);
  // attaches the servo on pin 3 to the servo object
  gasservo.attach(5);  
  // attaches the servo on pin 5 to the servo object
  oilbypassservo.attach(6);
  // set  the transistor pin as output:
  pinMode(oilpumptransistorPin, OUTPUT);
  // set  the motor pin as an output
  pinMode(dieselpumptransistorPin, OUTPUT);
  // set up Serial library at 9600 bps
  Serial.begin(9600);        

}

void loop()
{//0
  // read the state of the keybutton value:
  buttonState = digitalRead(keythatcontrollsallbuttonPin);
  // check if the keybutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH)
{//1

  //---------------------------------
  //diesel pump pwm routine
  //---------------------------------
  //checks if oil pump is on
  if (inputVariable4 == 1)
{//
    // read the value from the sensor:
    potValue = analogRead(potPin) / 4;        // read the potentiometer, convert it to between 0 - 255 for the value accepted by the digital pin.
    analogWrite(dieselpumptransistorPin, potValue); // potValue alters the supply from pin 9 which in turn controls the power running through the transistor
    //
    Serial.print("test2");
}//
    else
{//
}//

    //---------------------------------
    //start button check
    //---------------------------------
    // turn LED on:
    digitalWrite(powerledpin, HIGH);
     val = digitalRead(switchthatstartsPin);      // read input value and store it in val
     delay(10);                         // 10 milliseconds is a good amount of time
     val2 = digitalRead(switchthatstartsPin);     // read the input again to check for bounces
     if (val == val2) {        //2         // make sure we got 2 consistant readings!
       if (val != buttonState2) { //3         // the button state has changed!
         if (val == LOW) {        //4        // check if the button is pressed
           if (lightMode == 0) {    //5      // is the light off?
             lightMode = 1;               // turn light on!
      Serial.print("test");
  
 
  //---------------------------------
  //oil pump start cannot be removed
  //---------------------------------
  //checks if oil pump is on
  if (inputVariable1 == 0)
{//6
    //oil pump on
    digitalWrite(oilpumptransistorPin, HIGH);
    //turns this part off
    inputVariable1 = 1;
    delay(100);
    // turn LED on:
    digitalWrite(oilpumpledpin, HIGH);
    Serial.print("test2");
}//6
    else
{//7
}//7
    
    
  //---------------------------------
  //starting sequence
  //---------------------------------
  if (inputVariable2 == 0)
{//8
    //oil bypass open
    oilbypassservo.write(180);
    //gas valve open
    gasservo.write(180);
    // waits for the servo to get there    
    delay(15);                            
    //gas valve open
    delay(1000);
    oilbypassservo.write(1);
    gasservo.write(25);
    // waits for the servo to get there    
    delay(15);
    //turns this part off
    // turn LED on:
    digitalWrite(propaneinjectionledpin, HIGH);
    //turns this part off
    inputVariable2 = 1;
    delay(10);
    inputVariable4 = 1;
}//8
    else
{//9
}//9
} //5
     else
{//10
     lightMode = 0;               // turn light off!
}//10
}//4        
} //3
     buttonState2 = val;                 // save the new state in our variable
}//2
}//1
  //if key goes away
  else
{//11
  // turn LED off:
    digitalWrite(powerledpin, LOW);    
  //---------------------------------
  //oil pump stop cannot be removed
  //---------------------------------
  //checks if oil pump is on
  if (inputVariable1 == 1)
{//13
    // turn LED off:
    digitalWrite(powerledpin, LOW);
    digitalWrite(oilpumpledpin, LOW);
    digitalWrite(propaneinjectionledpin, LOW);
    inputVariable2 = 0;     // zerro check
    inputVariable4 = 0;
    analogWrite(dieselpumptransistorPin, LOW);
    Serial.print("blank             ");
    delay(10000);
    //oil pump on
    digitalWrite(oilpumptransistorPin, LOW);
    //turns this part off
    inputVariable1 = 0;
    Serial.print("test4");
}//13
    else
{//14
}//14
}//11
}//0

  


40  Forum 2005-2010 (read only) / Troubleshooting / Re: help me on: April 05, 2010, 04:17:26 pm
i found the error why it does not let the diesel pump be regulatet

void setup() {
  // Set the switch pin as input
  pinMode(switchPin, INPUT);
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);
  // initialize the keybutton pin as an input:
  pinMode(buttonPin, INPUT);
 // attaches the servo on pin 2 to the servo object
  myservo.attach(3);

  // set  the transistor pin as output:
  pinMode(transistorPin, OUTPUT);
  pinMode(transistorPin2, OUTPUT);
  // set  the motor pin as an output

  // set up Serial library at 9600 bps
  Serial.begin(9600);

it is the underlined script in the void setup

how can i fix that?

somone help pleas

(i know i did not adjust my own coments on the things)

just to buzzie building the scripts
41  Forum 2005-2010 (read only) / Troubleshooting / Re: help me on: April 04, 2010, 11:56:40 am
how can i make these funktions work that would be the ansere to my problem

and the pwm i am testing it with an led
when put alone the diesel pump (led) dimms and go faster (lighter)

but when imbedded in my big script it does not do anything

ps i will clean up my code soon thank you for the tip
42  Forum 2005-2010 (read only) / Troubleshooting / Re: help me on: April 04, 2010, 07:49:08 am
the voltage 12 volt

and the current is arount 1 or 2 amps

it is driven by a tip 120
so it isnt hardware

but can you see if this code helps you

Code:

#include "Servo.h"

Servo myservo; // create servo object to control a servo


// constants won't change. They're used here to
// set pin numbers:

int potPin = 0;                       // Analog pin 0 connected to the potentiometer
int transistorPin2 = 10;                // connected from digital pin 9 to the base of the transistor
int potValue = 0;                      // value returned from the potentiometer

const int switchPin = 4;     // the number of the start button pin
const int buttonPin = 2;     // the number of the pushbutton pin
const int ledPin =  12;      // the number of the LED pin
const int ledPin1 =  13;      // the number of the LED pin
const int ledPin2 =  14;      // the number of the LED pin
const int transistorPin = 9;    // connected to the base of the transistor


// variables will change:

// switch is connected to pin 2
int buttonState = 0;         // variable for reading the keybutton status
int inputVariable1 = 0;     // oil pump check
int inputVariable2 = 0;     // start up check
int inputVariable3 = 0;     // diesel check
int val;                        // variable for reading the pin status
int val2;                       // variable for reading the delayed/debounced status
int buttonState2 = 0;                // variable to hold the button state
int lightMode = 0;              // Is the light on or off?

void setup() {
  // Set the switch pin as input
  pinMode(switchPin, INPUT);
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the keybutton pin as an input:
  pinMode(buttonPin, INPUT);
  // attaches the servo on pin 2 to the servo object
  myservo.attach(3);  
  // set  the transistor pin as output:
  pinMode(transistorPin, OUTPUT);
  pinMode(transistorPin2, OUTPUT);
  // set  the motor pin as an output

  // set up Serial library at 9600 bps
  Serial.begin(9600);        

}

void loop(){//0

  // read the state of the keybutton value:
  buttonState = digitalRead(buttonPin);
  // check if the keybutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {    //1
    // turn LED on:
    digitalWrite(ledPin, HIGH);
    
     val = digitalRead(switchPin);      // read input value and store it in val
     delay(10);                         // 10 milliseconds is a good amount of time
     val2 = digitalRead(switchPin);     // read the input again to check for bounces
     if (val == val2) {        //2         // make sure we got 2 consistant readings!
       if (val != buttonState2) { //3         // the button state has changed!
         if (val == LOW) {        //4        // check if the button is pressed
           if (lightMode == 0) {    //5      // is the light off?
             lightMode = 1;               // turn light on!
      Serial.print("test");
  
    
  //---------------------------------
  //oil pump start cannot be removed
  //---------------------------------
  //checks if oil pump is on
  if (inputVariable1 == 0){//6
    //oil pump on
    digitalWrite(transistorPin, HIGH);
    //turns this part off
    inputVariable1 = 1;
    // turn LED on:
    digitalWrite(ledPin1, HIGH);
    Serial.print("test2");
    }//6
    else {//7


    }//7
    
    
  //---------------------------------
  //starting sequence
  //---------------------------------

  if (inputVariable2 == 0){//8
    //gas valve open
    myservo.write(180);
    // waits for the servo to get there    
    delay(15);                            
    //gas valve open
    delay(1000);
    myservo.write(1);
    // waits for the servo to get there    
    delay(15);
    //turns this part off
    // turn LED on:
    digitalWrite(ledPin2, HIGH);
    //turns this part off
    inputVariable2 = 1;
    }//8
    else {//9


 


    inputVariable2 = 1;
 
  
    }//9

        } //5
        else {//10
          lightMode = 0;               // turn light off!
    digitalWrite(ledPin, LOW);

    digitalWrite(ledPin1, LOW);

    digitalWrite(ledPin2, LOW);
    
          //help
  // read the value from the sensor:

  potValue = analogRead(potPin) / 4;        // read the potentiometer, convert it to between 0 - 255 for the value accepted by the digital pin.
  analogWrite(transistorPin2, potValue); // potValue alters the supply from pin 9 which in turn controls the power running through the transistor
  //
          
        }//10
         }//4
        
       } //3
           buttonState2 = val;                 // save the new state in our variable
     }//2
    
  }//1

  
  //if key goes away
  else {//11


    if (inputVariable2 == 1){//12
    delay(100);
    // turn LED off:
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, LOW);
    inputVariable2 = 0;     // zerro check
    lightMode = 0;               // turn light off
    
    
        
  //---------------------------------
  //oil pump stop cannot be removed
  //---------------------------------
  //checks if oil pump is on
  if (inputVariable1 == 1){//13
    // turn LED off:
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, LOW);
    inputVariable2 = 0;     // zerro check
    
    
    Serial.print("blank             ");
    delay(10000);
    //oil pump on
    digitalWrite(transistorPin, LOW);
    //turns this part off
    inputVariable1 = 0;
    Serial.print("test4");
    }//13
    else{//14

    }//14
    }//12
  }//11
  
}//0

  

the scematicks doensn fit this no more

cus i added a switch

http://img269.imageshack.us/i/arduinodisign.jpg/
43  Forum 2005-2010 (read only) / Troubleshooting / Re: help me on: April 04, 2010, 04:53:26 am
no the servo's are both working perfect

but i have also 2 motors 1 oil pump
the oil pump is always on
and the second is a diesen pump and that is the one that causes problems

i made a script to pwm that motor but it does not do anything and when i run the script witout the rest arount it it does work

it is the diesel pump motor that doent wants to be controlled by the pot
44  Forum 2005-2010 (read only) / Troubleshooting / Re: help me on: April 03, 2010, 02:56:07 am
ther isnt any need for a feedback

becaus it is a gas turbine (hommade out of a car turbo)

they are rated for 5000 rpm
if you build a gas turbine it could go as fast as 100000 rpm

and the heat in the combustion chamber is goeing to exeed 600 degrees celcius

the only thing that i would like is a oil presiure sensor

the scematix are at the bottum

but the main problem is
evrything works exept the secend motor wont start up or be controlled by a potentiometer




45  Forum 2005-2010 (read only) / Troubleshooting / help me on: April 02, 2010, 05:02:01 pm
i have a problem i am writing a script that can controll
1 servo (automatic)
1 motor (automatic) full speed
1 motor (manual pwm)
3 leds that indicate the stage

it is a script for starting a jet engine

i will describe the procitiure
(remember the script isnt done yet)
all wit a * isnt scripted yet

power on
ignition on (will be scripted)
you turn the key (switch)
oilpump starts (motor)
w8 10 sec (delay)
*puts bypass open (servo)
open gas valve (servo)
w8 60 sec (delay) combustion chamber heats up
*closses bypass (servo)
w8 60 sec (delay) combustion camber gets hotter
closes valve 3/4 (servo) to keep the engine running
starts diesel pump (motor)

if you turn the key off (switch)
all varibles get reseted
oilpump remains on (motor)
60 sec delay (engine cools down)
oilpump shuts down


but the problem is
i cant get to controll the diesel pump motor
who could help me fix this problem
or clean up my scripting (that would be nice)

Code:

#include "Servo.h"

Servo myservo; // create servo object to control a servo


// constants won't change. They're used here to
// set pin numbers:

int motor = 10;
int sensorPin = 0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor

const int buttonPin = 2;     // the number of the pushbutton pin
const int ledPin =  12;      // the number of the LED pin
const int ledPin1 =  13;      // the number of the LED pin
const int ledPin2 =  14;      // the number of the LED pin
const int transistorPin = 9;    // connected to the base of the transistor


// variables will change:


int buttonState = 0;         // variable for reading the keybutton status
int inputVariable1 = 0;     // oil pump check
int inputVariable2 = 0;     // start up check
int inputVariable3 = 0;     // diesel check

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the keybutton pin as an input:
  pinMode(buttonPin, INPUT);
  // attaches the servo on pin 2 to the servo object
  myservo.attach(3);  
  // set  the transistor pin as output:
  pinMode(transistorPin, OUTPUT);
  // set  the motor pin as an output
  analogWrite(motor, OUTPUT);
  // set up Serial library at 9600 bps
  Serial.begin(9600);        

}

void loop(){

  // read the state of the keybutton value:
  buttonState = digitalRead(buttonPin);
  // check if the keybutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {    
    // turn LED on:
    digitalWrite(ledPin, HIGH);
    Serial.print("test");
  
    
  //---------------------------------
  //oil pump start cannot be removed
  //---------------------------------
  //checks if oil pump is on
  if (inputVariable1 == 0){
    //oil pump on
    digitalWrite(transistorPin, HIGH);
    //turns this part off
    inputVariable1 = 1;
    Serial.print("test2");
    }
    else {
    // turn LED on:
    digitalWrite(ledPin1, HIGH);
    Serial.print("test3    ");
    }
    
    
  //---------------------------------
  //starting sequence
  //---------------------------------

  if (inputVariable2 == 0){
    //gas valve open
    myservo.write(180);
    // waits for the servo to get there    
    delay(15);                            
    //gas valve open
    delay(1000);
    myservo.write(1);
    // waits for the servo to get there    
    delay(15);
    //turns this part off
    inputVariable2 = 1;
    }
    else {


  
    // turn LED on:
    digitalWrite(ledPin2, HIGH);
      //help
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  sensorValue = map(sensorValue, 0, 1023, 0, 250);
  analogWrite(motor, sensorValue);
  //

    //turns this part off
    inputVariable2 = 1;
 
  
    }



  }


  
  //if key goes away
  else {


    if (inputVariable2 == 1){
    delay(100);
    // turn LED off:
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, LOW);
    inputVariable2 = 0;     // zerro check
    
    
        
  //---------------------------------
  //oil pump stop cannot be removed
  //---------------------------------
  //checks if oil pump is on
  if (inputVariable1 == 1){
    // turn LED off:
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, LOW);
    inputVariable2 = 0;     // zerro check
    
    
    Serial.print("blank             ");
    delay(10000);
    //oil pump on
    digitalWrite(transistorPin, LOW);
    //turns this part off
    inputVariable1 = 0;
    Serial.print("test4");
    }
    else{

    }
    }
  }
  }

and remember this is my firsth script so it could look messy
Pages: 1 2 [3] 4 5