LED

RevivingIndia Meena bazar, Patna, India

What is LED ? LED stands for Light Emitting Diode. It's a semiconductor device that emits light when an electric current passes through it. Things to do Connect Annode (+) part of Led to Digital pin of Arduino i.e 13 Connect Cathode(-) part of Led to Groundpin of Arduino Interfacing Diagram Interface a microcontroller, like an Arduino, with external components, you typically use a combination of wiring and programming. Here's a short overview of the basic steps: Identify the components you want to interface with the Arduino, such as sensors, LEDs, motors, etc. Determine the electrical requirements of these components (voltage, current, signal levels). Connect the components to the appropriate pins on the Arduino board using jumper wires, breadboard, or soldering depending on your setup. Write a program (sketch) in the Arduino IDE to control and interact with these components. This involves configuring pins, reading sensor data, and sending signals…

Read more

Python String

RevivingIndia Meena bazar, Patna, India

What is String? String is a collection of alphabets, words or other characters. It is one of the primitive data structures and are the building blocks for data manipulation. Python has a built-in string class named str . Python strings are "immutable" which means they cannot be changed after they are created. Create with Single quotes:  String1 = 'Welcome to the Reviving India' print(String1) print(type(String1)) Double quotes: String1 = “Welcome to the Reviving India” print(String1) print(type(String1)) Triple quotes: String1 = '''Python Tutorial''' String2 = """ Hello world""" print(String1,String2) print(type(String1),type(String2)) Read or Access String Complete String Single substring Multiple substring Example: String1 = 'Welcome to the Reviving India' print(String1)   #Complete String print(String1) #Ist substring print(String1) #Last substring print(String1) #Mutiple substring Update Updating of substring from a String is not allowed. This will cause an error because item assignment from a String is not supported Insert Inserting of substring from a String…

Read more

Programming Question

RevivingIndia Meena bazar, Patna, India

String Programming Question What is the purpose of string indexing in Python? How do you access the first character of a string? How do you access the last character of a string using negative indexing? How do you access the second character of a string? How do you access a character at index 3 in a string? What happens if you try to access an index that is out of range in a string? How do you slice a string to get the substring from index 2 to index 5? How do you slice a string to get the first three characters? How do you slice a string to get the last three characters? How do you slice a string to get every second character? How do you slice a string to get the characters from index 2 to index 7 with a step of 2? How do you reverse…

Read more

RGB

What is RGB? RGB, short for Red Green Blue, is a color model used in digital imaging to represent colors on screens. It combines different intensities of red, green, and blue light to create various colors. How to use RGB Interior Lighting Art Projects Signage and Displays Gaming Stage Lighting Automotive Lighting Home Automation Prototyping Components Required: Microcontroller (Arduino) RGB Jumper Wires USB Cable Working Interface: The RGB LED is connected to the Arduino via jump wires on a breadboard. Arduino code, controls the LED's colors based on input, like touch or proximity sensors Example Code: void setup() { pinMode(8,OUTPUT); // Red led pin pinMode(9,OUTPUT); // Green led pin pinMode(10,OUTPUT); // Blue led pin } void loop() { digitalWrite(8,HIGH); // Red led ON digitalWrite(9,LOW);  // Green led OFF digitalWrite(10,LOW); // Blue led OFF delay(1000); digitalWrite(8,LOW);  // Red led ON digitalWrite(9,HIGH);  // Green led OFF digitalWrite(10,LOW);  // Blue led OFF delay(1000);…

Read more

Python Set and Dictionary

RevivingIndia Meena bazar, Patna, India

What is Set? A Set is an unordered collection data type that is iterable, mutable, and has no duplicate elements. A set is a collection that is both unorderedand unindexed. Sets are written with curly brackets. How to create Set? myset = {"revin", "reviving", 54, 54.36} print(myset) x = set() print(x,type(x)) Empty Set # Empty set using set() function   myset= set() print(type(myset)) Read and Access In set we can’t access using index or key only we can loop to get the elements or items of set. myset = {"revin", "reviving", 54, 54.36} for var in myset: print(myset) print(myset) #complete accesss Add or Change We cannot change its items, but you can add new items.We can add new items with add() & update() method Add() method  to add one item to a set use the add() method. myset.add(“hello world") print(myset) Update method() To add items from another set into the current set, use the update() method. myset1 = {"revin", "reviving",…

Read more