Hi from Italy , sorry for my english. I'm new in the Arduino's world
I want to blink an LED (led 3w 2.5/3v) with a pulse from a receiver RC hobby.
There is a code already written that I can adapt?
for example:
thanks a lot
Hi from Italy , sorry for my english. I'm new in the Arduino's world
I want to blink an LED (led 3w 2.5/3v) with a pulse from a receiver RC hobby.
There is a code already written that I can adapt?
for example:
thanks a lot
As long as any replies there are translated and posted here (and vice versa) it's OK.
There is a code already written that I can adapt?
Untested and not the preferred way to do it but try this
const byte inputPin = 2;
const byte ledPin = 3;
const long longPeriod = 1000;
const byte shortPeriod = 500;
byte ledState = LOW;
void setup()
{
pinMode(inputPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop()
{
if (pulseIn(inputPin, HIGH) <= 1500)
{
delay(longPeriod);
}
else
{
delay(shortPeriod);
}
ledState = !ledState;
digitalWrite(ledPin, ledState);
}
thanks for the answers and code
I'll try as soon as possible
Can I connect leds directly to the Arduino board? (not use transistor/mosfet)
the leds are:
Spec:
Input: 2.5-3 volts (3watt)
Colour: Green
Brightness: 70-80 Lumens
Diameter: 20mm
Weight: 4g
Can I connect leds directly to the Arduino board? (not use transistor/mosfet)
the leds are:
As a rule-of-thumb I'd say "if the LED requires a heatsink (like yours), then no, you can't connect it directly to an AVR I/O pin".
Input: 2.5-3 volts (3watt)
So, one amp, eh?
The Arduino does not have one amp output drivers.