Irish Distributors for Velleman & Kitronik
Please Click Here to leave a review on TRUSTPILOT after your purchase and delivery
Irish Distributors for Velleman & Kitronik
Please Click Here to leave a review on TRUSTPILOT after your purchase and delivery
Kitronik LAB:bit educational platform for BBC micro:bit REDUCED FROM €47.97 to €36.00 CLICK HERE
See our reduced prices on our LAB Bench Power Supplies CLICK HERE
See our digital gift card. After the purchase, you will receive an email with the gift card and instructions on how to use it. The card can be used as payment for any products we have. CLICK HERE
Light Module Light Cup Board KY-027 PWM Output Arduino DIY project
Control LED Status For Arduino DIY Project Working Voltage 5V Output: Digital Voltage Output (0/1) PWM Output Material: PCB Colour: Black Dimensions: 0.91 x 0.79 x 0.59 Inch / 2.3 x 2 x 1.5 CM PACKAGE INCLUDES: Light Module Light Cup Board KY-027 PWM Output Arduino DIY project Arduino Sketch Below:
int LedPinA = 5;
int LedPinB = 6;
int ButtonPinA = 7;
int ButtonPinB = 4;
int buttonStateA = 0;
int buttonStateB = 0;
int brightness = 0;
void setup()
{
pinMode(LedPinA, OUTPUT);
pinMode(LedPinB, OUTPUT);
pinMode(ButtonPinA, INPUT);
pinMode(ButtonPinB, INPUT);
}
void loop()
{
buttonStateA = digitalRead(ButtonPinA);
if (buttonStateA == HIGH && brightness != 255)
{
brightness ++;
}
buttonStateB = digitalRead(ButtonPinB);
if (buttonStateB == HIGH && brightness != 0)
{
brightness --;
}
analogWrite(LedPinA, brightness); // A will turn off gradually
analogWrite(LedPinB, 255 - brightness); // B will turn on gradually
delay(25);
}
Terminals
G = Ground
+ = +5V
S = Signal
L = LED
Another Code example ArduinoConnections Arduino:
LED + = [Pin 13]
LED - = [Pin GND]
Sensor signal = [Pin 10]
Sensor +V = [Pin 5V]
Sensor - = [Pin GND]
Code example Raspberry Pi
# Needed modules will be imported and configured.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
# Declaration of the LED and sensor pins
LED_PIN = 24
Sensor_PIN = 23
GPIO.setup(Sensor_PIN, GPIO.IN)
GPIO.setup(LED_PIN, GPIO.OUT)
print "Sensor-test [press ctrl+c to end the test]"
# This output function will be started at signal detection
def ausgabeFunktion(null):
GPIO.output(LED_PIN, True)
# This output function will be started at signal detection
GPIO.add_event_detect(Sensor_PIN, GPIO.FALLING, callback=ausgabeFunktion, bouncetime=10)
# main program loop
try:
while True:
time.sleep(1)
# output will be reseted if the switch turn back to the default position.
if GPIO.input(Sensor_PIN):
GPIO.output(LED_PIN,False)
# Scavenging work after the program has ended
except KeyboardInterrupt:
GPIO.cleanup()
Connections Raspberry Pi:
LED = GPIO24 [Pin 18]
Signal = GPIO23 [Pin 16]
+V = 3,3V [Pin 1]
GND = GND [Pin 6]
All products listed on our website as in stock are here in Cork are ready to ship.
We ship orders on Monday to Friday and, in most cases, orders are delivered the next working day. However, there are times when a delay may be experienced beyond our control. Cut off times for next day deliveries are 2.00pm.
Delivery charges quoted apply to delivery in the 32 counties of ireland only
Free signed for delivery on all orders over €30.00.
Delivery charge of €8.00 appiles to all orders under €30.00 (signed for delivery)
We use fastway couriers for all our shipments in ireland.
For more on our delivery and shipping charges, see here.
Credit terms and discounts for the educational sector i.e. Secondary schools, colleges and universities are available. Please contact us for further information.
Quality electronic products at affordable prices
All Rights Reserved | EDHHD Trading Ltd t/a Irish Electronics