Show Posts
Pages: 1 ... 7 8 [9] 10 11 ... 20
121  Using Arduino / Programming Questions / Re: what input pin is it using? on: January 18, 2013, 04:17:00 pm
hi thanks for your replies on that link http://www.gammon.com.au/forum/?id=11488 there is a lot of stuff on that website to get your head wrapped around lol i have come up with this compiles fine but somethings telling me im missing something here?

Code:


volatile int rpmcount;
int sensorState = 0;
unsigned int rpm;
unsigned long timeold;


ISR (PCINT2_vect)
 {
 // handle pin change interrupt for D0 to D7 here
 }  // end of PCINT2_vect


void setup ()
  {
  Serial.begin(9600); 
  // pin change interrupt (example for D0)
  PCMSK2 |= _BV (PCINT16);  // want pin 0
  PCIFR  |= _BV (PCIF2);   // clear any outstanding interrupts
  PCICR  |= _BV (PCIE2);   // enable pin change interrupts for D0 to D7
  }

void loop(){
 
   if(rpmcount>=5) {
      rpm=(60000*rpmcount)/(8*(millis()-timeold)); //the 8 changes to 4 if 4 magnets are used.
      timeold = millis();
      //Serial.println(rpmcount,DEC);
      rpmcount = 0;
      Serial.println(rpm,DEC);
   }
}


p.s i dont wont the led output
122  Using Arduino / Programming Questions / Re: what input pin is it using? on: January 18, 2013, 01:34:55 pm
ok so basically leave it there but take the internals out of it.

would this work or am i barking up the wrong tree?

Code:


volatile int rpmcount;
int sensorState = 0;
unsigned int rpm;
unsigned long timeold;
int rpm1 =1;


void setup() {
  Serial.begin(9600); 
 pinMode(INPUT, rpm1);
}
void loop(){
 
   if(rpm1>=5) {
      rpm=(60000*rpmcount)/(8*(millis()-timeold)); //the 8 changes to 4 if 4 magnets are used.
      timeold = millis();
      //Serial.println(rpmcount,DEC);
      rpmcount = 0;
      Serial.println(rpm,DEC);
   }
}
123  Using Arduino / Programming Questions / Re: what input pin is it using? on: January 18, 2013, 01:04:48 pm
o ok i see thanks for that link one problem i can see is i am using an arduino uno and i will eventually need 3 hall inputs so how will i overcome that?

Quote
There's a delay(50) in the ISR. Not a good idea.
yes there is where it is blinking the led i dont actually need that led how can i get rid of that function as ive noticed if i remove void rpm_fun() i get a error
124  Using Arduino / Programming Questions / what input pin is it using? on: January 18, 2013, 12:00:41 pm
hi there just looking into using a hall sensor on my arduino and came across this code below, i dont know if im being blind but where does it state which input pin its using?

Code:


const int ledPin = 13;
volatile int rpmcount;
int sensorState = 0;
unsigned int rpm;
unsigned long timeold;

void rpm_fun()
 {
      rpmcount++;
      digitalWrite(ledPin, HIGH);
      delay(50);
      digitalWrite(ledPin, LOW);
 }
 
void setup() {
  pinMode(ledPin, OUTPUT);     
  Serial.begin(9600); 
  attachInterrupt(0, rpm_fun, FALLING); 
}

void loop(){
 
   if(rpmcount>=5) {
      rpm=(60000*rpmcount)/(8*(millis()-timeold)); //the 8 changes to 4 if 4 magnets are used.
      timeold = millis();
      //Serial.println(rpmcount,DEC);
      rpmcount = 0;
      Serial.println(rpm,DEC);
   }
}
125  Using Arduino / Displays / Re: ITDB02_Touch problems on: December 24, 2012, 03:49:40 pm
how ?
that was a guess as i have no idea
126  Using Arduino / Displays / Re: ITDB02_Touch problems on: December 18, 2012, 03:15:56 pm
Code:

 drawButton(0,0,54,385,"ON");
if(isButtonTouched(100,170,50,100)) {

        digitalWrite(13, HIGH);   // set the LED on
      }
 drawButton(0,0,218,385,"OFF");     
if(isButtonTouched(100,170,170,270)) {

        digitalWrite(13, LOW);    // set the LED off
      }


this is what i have at mo when i compile it i get drawButton was not declared in this scope  so i am missing sumthing?
127  Using Arduino / Displays / Re: ITDB02_Touch problems on: December 17, 2012, 03:50:21 pm
no sorry, how do i fit that into my code?
128  Using Arduino / Displays / Re: ITDB02_Touch problems on: December 17, 2012, 01:50:10 pm
hi thanks for that but could you elaborate on it as i dont quite follow
129  Using Arduino / Programming Questions / Re: ionisiation? on: December 06, 2012, 12:59:20 pm
Quote
I really don't think you need an op amp for this. The Arduino pins have very high input resistance (around 100 Mohms), so detecting the difference between 1.7Mohms and infinity is easy. I used a voltage divider made from two 4.7Mohm resistors with an atmega328p in a recent project. However, you will need to take precautions against picking up interference. I suggest you connect your ionisation probe between the input pin and ground, use a 4.7Mohm pullup resistor to +5V, and also connect a 0.1uF capacitor between the input pin and ground.
i did try this but did not seem to work


Quote
You can get finer control by putting fixed resistors in the top and bottom of the pot so the wiper covers a smaller of voltages. Also try reducing the gain a bit

 i haven't altered the gain at all, i presume to lower the gain i reduce the value size of the 100k which is connected to the output of the op amp?
right i think i've got it working in a matter of speaking with out altering the gain the problem i have now is it seems to be too sensitive still so putting my finger between the probes is enough to activate it.
130  Using Arduino / Programming Questions / Re: ionisiation? on: December 01, 2012, 01:04:27 pm
right i tried that and it didnt seem to work when adjusting the pot it just seemed to be all the way one way or all the way the other. i dont know if i need a higher rotation pot so i can be more accurate with it? im currently using something like a 300 degree at the moment
131  Using Arduino / Programming Questions / Re: ionisiation? on: November 24, 2012, 04:48:26 pm
ok cool i got it now thanks, will have to get some resistors in and have a play
132  Using Arduino / Programming Questions / Re: ionisiation? on: November 24, 2012, 04:30:42 pm
like that?
133  Using Arduino / Programming Questions / Re: ionisiation? on: November 23, 2012, 05:01:06 pm
thanks for the reply i am using a LM358 as this is what i had lying around.
ok can you draw that as this is all a bit now to my and will be easier to understand thanks
134  Using Arduino / Programming Questions / Re: ionisiation? on: November 23, 2012, 11:04:32 am
ok thanks for that i have had a bit of a play and come up with this
http://s906.photobucket.com/albums/ac270/Joes-110/?action=view&current=Untitled.png
but now we have gone to the other way now it is to sensitive and can not seem to dye down any idea?
135  Using Arduino / Programming Questions / Re: ionisiation? on: November 21, 2012, 12:40:18 pm
sorry to bring this back up again i had got this working but its extremely unstable as there is not much movement on the arduino, i was using 1500k resistor to even get it to work i cant seem to add any more than that or it seems to go the other way so i dont know how else we could make this work more reliably and give us more of a range on the arduino
i measured the resistance of the probe and flame was 1400k and my supply voltage i was running 17.11 and im getting back on the other end 1.65V so hell of a drop?
Pages: 1 ... 7 8 [9] 10 11 ... 20