digitalwrite problem

Hi.

Im looing at a project to turn the airbag light off on my car instrument.

(Before you all ask. Im fitting a later instrument in a car that dont have an airbag so the light is not required)

The unit is looking for a 5v for 5 seconds then 0v then it pulses every second between 5v and 0v. I was going to write a program that would digitalwrite high then delay 5 seconds then digitalwrite low then delay 1 second. But the 1 second needs to be looped.

Is there an easy way in which i could write this.

Have you tried the "Blink" example?

What does "But the 1 second needs to be looped" mean?

Do you know how much current the light requires? You don't want to power more than about 20mA with an I/O pin. If you power it directly use a 220 ohm or higher resistor in series.

The loop function repeats over and over. Look at the basic blink sketch. Make your pin high for 5 seconds in setup since that needs to happen only once at startup, and then use the regular blink sketch to make the pin cycle high and low with a 1s delay.

The light is graphic msg on a lcd display and is controlled via the cpu of the instrument. So the output off the arduino should be able to cope.

Would it take much to make it do all the blinking after it detects a digitalread. So say pin went high then it started the 5 second delay then the blink

ullisees:
Would it take much to make it do all the blinking after it detects a digitalread. So say pin went high then it started the 5 second delay then the blink

No it wouldn’t take much.

This is very basic stuff. You ought to try some of the tutorials with a button and LED.

Hi, If you don't want the light to operate, remove the LED/globe. If a globe has to be there, replace it with a resistor.

Tom... :)

TomGeorge: If you don't want the light to operate, remove the LED/globe.

Or paint it black

...R

Hi.

Or paint it black

Yes, reminds me of a car we used to have, a good lold Datsun 1200 Stationwagon(Estate car to the UK). The HIGH BEAM indicator light was that bright it was a nuisance while driving at night, dad placed a bit of black tape over the part of the dash that was over the HIGH BEAM bezel so it didn't shine in your eyes.

Tom.. 8)

TomGeorge: The HIGH BEAM indicator light was that bright it was a nuisance while driving at night, dad placed a bit of black tape over the part of the dash that was over the HIGH BEAM bezel so it didn't shine in your eyes.

I did that too.

I guess the designers just worked 9 to 5 and never tried their products at night.

...R