Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Programming Questions / Re: Analog read , problems on: February 15, 2014, 06:06:10 pm
Perfect !!

now my questions are completed .

Many thanks,

Regards,

Patrick
2  Using Arduino / Programming Questions / Re: Analog read , problems on: February 15, 2014, 06:00:57 pm
Hi ,

I have look for the  divide marker >> in the Arduino Cookbook but can't find no information from this.
either the combination  else .. if is not explain in the Cookbook ( only if ... else )

Where can i find those information  ??


Thanks in advance ,

Patrick.

3  Using Arduino / Programming Questions / Re: Analog read , problems on: February 15, 2014, 05:29:03 pm
Ahaa...

The 1023 / 4 = 255

Thanks !!

Regards ,

Patrick
4  Using Arduino / Programming Questions / Re: Analog read , problems on: February 15, 2014, 05:18:54 pm
Hi , NY

This exact what i mean ,

What does this part of the sketch mean :

val = analogRead(0)>>2;

please explain it to me,

Many thanks !!

Patrick

5  Using Arduino / Programming Questions / Re: Analog read , problems on: February 15, 2014, 04:08:18 pm
Hi ,

if (val < 74 )
 {
 Serial.println("  Value < 74" ); 
   digitalWrite(ledPin,LOW);
 
between 0 and 74 the LED should be OFF , this is working !!
 }

if (val > 74 )
 {
  Serial.println("  Value > 74" );    <<<will not work
   digitalWrite(ledPin,HIGH);

when the value is 75 , the LED will ON , this is working !!!

if (val >119 )
  {
 // Serial.println("  Value < 119" );     <<<will not work
    digitalWrite(ledPin,LOW);

when the value is less than 119 , the LED will OFF , this is working !!

But it won't work when i insert the text ???

I hope inform you well

Regards,

Patrick



6  Using Arduino / Programming Questions / Analog read , problems on: February 15, 2014, 03:54:01 pm
Hi ,

I have made the next sketch:

Code:

int ledPin = 13;
int val = 0;

void setup(){
 Serial.begin(9600);
 pinMode(ledPin,OUTPUT);

}
 
 void loop()
{
 Serial.print(val);
 
  val = analogRead(0);
 val /=4;  // converter 0-1023 naar 0-255


 if (val < 74 )
 {
 Serial.println("  Value < 74" );   [color=red]<<<will not work [/color]
   digitalWrite(ledPin,LOW);
 
 }

if (val > 74 )
 {
  Serial.println("  Value > 74" );    [color=red]<<<will not work [/color]
   digitalWrite(ledPin,HIGH);

 
  if (val >119 )
  {
 // Serial.println("  Value < 119" );     [color=red]<<<will not work [/color]
    digitalWrite(ledPin,LOW);

 }
if (val > 139 )
 {
  //Serial.println("  Value > 139" );              [color=red]<<<will not work [/color]
   digitalWrite(ledPin,HIGH);

 }

  }

}


but it's not working correct , and i can't find the problem.
When i turn the potentiometer from 0 - 74 the LED is off , and will on at 75.
When i turn the potentiometer from 74 - 119 the LED will OFF after reach 119.
When i turn the potentiometer from 119 - 139 , after reach 139 the LED wil ON

This is working well,
But now i will put some text in this sketch , it will show the status at hyperterminal
But unfortunately this won't work  smiley-confuse

the LED will ON at 75 and will not turn OFF ( when i have insert te text in this sketch ,

Please some advice , what iám doing wrong,

Thanks in advance ,

Patrick
7  Using Arduino / Programming Questions / Re: IRRemote Program question on: August 25, 2013, 04:28:39 pm
Hi ,

I have attached a part of my sketch :

Code:
// LED RED ON

  if(results.value == 0xDDC837) //if the button one is pressed.

    {
    digitalWrite(ledPin, HIGH);
   
    }
    else
  // LED RED  OFF 
    if(results.value == [color=red]0xDDC03F[/color]) //if the button VOL+ is pressed.
   
    {
    digitalWrite(ledPin, LOW);


When i change 0xDDC03F in 0xDDC837 ( Button 1 Remote Controll ) nothing happens  smiley-roll

Can you give me a example / change for this ?

Thanks in advance !!

Patrick

8  Using Arduino / Programming Questions / IRRemote Program question on: August 25, 2013, 02:07:10 pm
Hello all,

I have programmed the Arduino Uno , for RC Control Use.
Find attached the link :

http://youtu.be/hsss3R_EhSs

No my question:
I use for example LED 1 on by push button 1 ( T.V Remote Control )
But when i will switch off the LED it's not possible to switch this LED off with the same button ??
In my example at you tube i used two buttons for switch ON / OFF the LED.

I will Switch ON / OFF the LED only by push button 1 ( T.V Remote Controller )

Please Someone advice me ?

Thanks in advance !!

Patrick.
9  Using Arduino / Programming Questions / ++ SOLVED ++ Arduino Programming Attiny85 Problem on: August 16, 2013, 02:50:34 pm
Hi,

I have hooked up a cirtcuit for program an Attiny85 , from the site:
http://hlt.media.mit.edu/?p=1695

The Green LED is blinking slowly just as told from this site,
after this i tryed to program the simple blink example , now the programn shows OUTPUT not declarered ?
I have search this forum about this issue and try some qeustions from this forum, but still the program shows the error.

I have also installed new arduino software , but nothing will solve this problem.
now i have run Arduino version 1.05 , but still no luck.

Maybe someone can help me to solve this issue,

Thanks in advance,

Patrick
10  International / Nederlands / 3 switches en 3 leds met 1 druk op knop led aan en blijft aan, on: February 03, 2013, 10:00:02 am
Hallo ,

Ik probeer het even op het NL Forum , in het engels kom ik er even niet mee weg ;-((
Ik heb een sketch waarin ik 3 leds afzonderlijk wil aansturen met 3 aparte switches.
dit heb ik in een array gezet , maar krijg het niet voor elkaar om nu alle drie de switches te gebruiken.
met onderstaans sketch werkt alleen de switch op pin 7 ( input ) met 10 als output.
De pinnen 8 en 9 reageren niet ??

Het is dus de bedoeling dat de schakelaar 1x wordt ingedrukt en de LED aanblijft, daarna weer indrukken en de LED gaat uit.

Dit dus bij drie switches , later zou ik er meer in de index kunnen bijvoegen,

Wie kan mij adviseren hierin ?

Akvast bedankt !!


Code:
// test 3 BUTTON , with 3 LEDS , Array.
// One Push Button , LED = ON and stay on !!
// After push the button , LED = OFF and stay off !!
// ArduinoPat

int LED [] = {11,12,13};  // the pin for the LED
int BUTTON[] = {7,8,9}; // the input for the BUTTON
                 
int val = 0;      // val will be used to store the state
                  // of the BUTTON pin
int old_val = 0;  // this variable stores the previous
                  // value of "val"
int state = 0;    // 0 = LED off and 1 = LED on

void setup()
{
  for(int index = 0; index < 3; index++)

{
  pinMode(LED[index], OUTPUT);   // tell Arduino LEDS is an output
  pinMode(BUTTON[index], INPUT); // tell Arduino BUTTON is an input
 
  digitalWrite(BUTTON[index],HIGH); // Pull-up Resistor
  }
 
}

void loop(){

    for(int index = 0; index < 3; index)                         
{
  int val  = digitalRead(BUTTON[index]);   // Against bouncing
  if ((val == HIGH) && (old_val == LOW))  // Against bouncing
  {
    state = 1 - state;                   // Against bouncing
    delay(10);                           // Against bouncing
  }

  old_val = val; // val is now old, let's store it

  if (state == 1) {     
    digitalWrite(LED[index], HIGH); // turn LED ON
  }
  else
  {
   digitalWrite(LED[index], LOW); // turn LED OFF
  }
}
}

Groet,

Patrick , ArduinoPat
11  Using Arduino / Programming Questions / Re: Array problem , 3buttons and three leds on: February 03, 2013, 08:36:22 am
Many thanks ash,

But i tryed to connect more swithes at this sketch but i make a mess of this ;-((

Code:
int Switch [] = {2,3,4};
int Led [] = {11,12,13};

boolean LedState =LOW;
int SwitchDebounce;
int LastSwitchState=HIGH;
int LastSwitchDebounce=LOW;

unsigned long LastDebounceTime = 0;
unsigned long DebounceDelay = 50;

void setup()
{
 
  for (int index = 0; index < 4; index++)
  pinMode(Switch[index],INPUT);
  digitalWrite(Switch[index],HIGH);
  pinMode(Led[index],OUTPUT);
}

void loop()
{
 for (int index = 0; index < 4; index++)
 
  {
  int CurrentSwitch = digitalRead(Switch[index]);
  if (CurrentSwitch != LastSwitchDebounce)
  {
    LastDebounceTime = millis();
  }
  if ((millis() - LastDebounceTime) > DebounceDelay)
  {
    if (CurrentSwitch != LastSwitchState)
    {
      if (CurrentSwitch == LOW)
      {
        LedState = !LedState;
      }
    }
    LastSwitchState=CurrentSwitch;
  }
  digitalWrite(Led[index],LedState);
  LastSwitchDebounce = CurrentSwitch;
  }
}

Your sketch is workin well , as you told !! thanks for this !

Regards ArduinoPat,
12  Using Arduino / Programming Questions / Re: Array problem , 3buttons and three leds on: February 03, 2013, 07:58:21 am
Hello all,

Quote
if Switch1 is press,LED1 light up, press the Switch1 again, LED1 turn off?
if Switch2 is press,LED2 light up, press the Switch2 again, LED2 turn off?
if Switch3 is press,LED3 light up, press the Switch3 again, LED3 turn off?

Yes this is the meaning about this sketch.

Quote
how do you connect the wire for the switches and LEDs?
do you have a pull-up/down for your switches?

These buttons are pull-down connected,

How can i make the Val and val_old as index ??

Greetz , ArduinoPat
13  Using Arduino / Programming Questions / Re: Array problem , 3buttons and three leds on: February 03, 2013, 07:31:56 am
Many thanks for quick reply Mark,

I have change the sketych and try this , but unfortunately it not works either,
Code:
// test 3 BUTTON , with 3 LEDS , Array.
// One Push Button , LED = ON and stay on !!
// After push the button , LED = OFF and stay off !!
// ArduinoPat

int LED [] = {11,12,13};  // the pin for the LED
int BUTTON[] = {7,8,9}; // the input for the BUTTON
                 
int val = 0;      // val will be used to store the state
                  // of the BUTTON pin
int old_val = 0;  // this variable stores the previous
                  // value of "val"
int state = 0;    // 0 = LED off and 1 = LED on

void setup()
{
  for(int index = 0; index < 3; index++)

{
  pinMode(LED[index], OUTPUT);   // tell Arduino LEDS is an output
  pinMode(BUTTON[index], INPUT); // tell Arduino BUTTON is an input
 
  digitalWrite(BUTTON[index],HIGH); // Pull-up Resistor
  }
 
}

void loop(){

    for(int index = 0; index < 3; index)                         
{
  int val  = digitalRead(BUTTON[index]);   // Against bouncing
  if ((val == HIGH) && (old_val == LOW))  // Against bouncing
  {
    state = 1 - state;                   // Against bouncing
    delay(10);                           // Against bouncing
  }

  old_val = val; // val is now old, let's store it

  if (state == 1) {     
    digitalWrite(LED[index], HIGH); // turn LED ON
  }
  else
  {
   digitalWrite(LED[index], LOW); // turn LED OFF
  }
}
}


Only by push the button connect at pin 7 will activate output pin 10,
the other pins will do nothing ;-((

Regards ArduinoPat,
14  Using Arduino / Programming Questions / Array problem , 3buttons and three leds on: February 03, 2013, 07:09:20 am
Hello,

I tryed the next sketch:

Code:
// test 3 BUTTON , with 3 LEDS , Array.
// One Push Button , LED = ON and stay on !!
// After push the button , LED = OFF and stay off !!
// ArduinoPat

int LED [] = {11,12,13};  // the pin for the LED
int BUTTON[] = {7,8,9}; // the input for the BUTTON
                 
int val = 0;      // val will be used to store the state
                  // of the BUTTON pin
int old_val = 0;  // this variable stores the previous
                  // value of "val"
int state = 0;    // 0 = LED off and 1 = LED on

void setup()
{
  for(int index = 0; index < 4; index++)

{
  pinMode(LED[index], OUTPUT);   // tell Arduino LEDS is an output
  pinMode(BUTTON[index], INPUT); // tell Arduino BUTTON is an input
 
  digitalWrite(BUTTON[index],HIGH); // Pull-up Resistor
  }
 
}

void loop(){

    for(int index = 0; index < 4; index)                         
{
  int val  = digitalRead(BUTTON[index]);   // Against bouncing
  if ((val == HIGH) && (old_val == LOW))  // Against bouncing
  {
    state = 1 - state;                   // Against bouncing
    delay(10);                           // Against bouncing
  }

  old_val = val; // val is now old, let's store it

  if (state == 1) {     
    digitalWrite(LED[index], HIGH); // turn LED ON
  }
  else
  {
   digitalWrite(LED[index], LOW); // turn LED OFF
  }
}
}

The meaning of this sketch is :
3 buttons , and 3 LEDs
push button one LED one is ON , and stay on ,after push again this button the LED goes off
Push button two LED two is ON , and stay on , after push again this button the LED goes off
Push button three LED three is ON , and stay on , after push again this button the LED goes off
also i have place a little sketch against bouncing during push the button,i think this is the problem it will not work ??

unfortunately this will not work,
Every button i push nothing happens.

Maybe someone can advice me what iám doing wrong ?

Greetz ,

ArduinoPat
15  Using Arduino / Networking, Protocols, and Devices / Re: SPI Led module Question on: January 25, 2013, 03:38:41 pm
When i start the sketch , the displays ( 8x ) are empty
I Open the Terminal and type 1 , the first 7segment is active now
when type two in the terminal , two appears at the first 7 segment , one is appeared at second 7 segement digit,

and this will go on till all (smiley-cool 7 segement displays are filled with a number.


Regards,

ArduinoPat
Pages: [1] 2 3 4