Posts

Program using Light Sensitive Sensors on Tinkercad

Image
    Objectives: ●       To understand the working of Light Sensitive Sensors ●       To understand the use of Arduino with Tinkercad ●       To study basic concepts of light intensity Light Sensitive Sensors - It is also called as LDR or Photoresister Requirements:   Component Quantity  Arduino Uno R3 1  Photoresistor(Light Sensitive Sensor) 1 1 kΩ Resistors 2 Red LED 1   Connections:   LED Arduino Uno Anode (+ve end of LED)  PIN  4 Cathode (-ve end of LED)  GND   Photoresister (Light Sensitive Sensor) Arduino Uno Terminal 1 GND,A0 Terminal 2 5v   Circuit Diagram: Connect components as given in the below...

Blink LED pattern using Arduino on Tinkercad

Image
Objectives : 1. To learn basic concepts of current flow. 2. To learn working of LED and Arduino Requirements: Name Quantity Component in Tinkercad Arduino UNO 1   Arduino Uno R3   Breadboard 1 Small Breadboard Resistor 3 1 kΩ Resistor LED 1 Red LED LED 1 Green LED LED 1 Blue LED LED:    Connections:   LED(RED) Arduino Uno Anode (+ve end of LED)  PIN No Cathode (-ve end of LED) GND   LED(GREEN) Arduino Uno Anode (+ve end of LED)  PIN No Cathode (-ve end of LED) GND   LED(BLUE) Arduino Uno Anode (+ve end of LED)  PIN No ...

Introduction to Arduino

Image
  Introduction to Arduino circuits and breadboarding What is Arduino? ●       Arduino is an open-source electronics prototyping platform built on user-friendly hardware and software. In a nutshell, Arduino is a prototyping board based on a microcontroller that can be used to create digital devices that can read inputs such as a finger pressing a button, a touch screen, a light on a sensor, etc., and turn them into outputs such as turning on an LED, turning on a motor, playing music through a speaker, etc. Fig 1: Key components of an Arduino board.                    [Source: https://docs.arduino.cc/learn/starting-guide/getting-started-arduino ]          1. Microcontroller - this is the brain of an Arduino, and is the component that we load programs into. Think of it as a tiny computer, designed to execute only a specific number of things.    ...

8 B. Design an AWT program to perform various string operations like reverse string, string concatenation etc.

 import java.awt.*; import java.awt.event.*; class StringFun extends Frame implements ActionListener { Label lstring1; TextField tfstring1; Button submit; TextArea display; StringFun() { lstring1 = new Label("String 1 (str1)"); tfstring1 = new TextField(); submit = new Button("Perform Operations"); display = new TextArea("", 2 , 100 , TextArea.SCROLLBARS_NONE); lstring1.setBounds(10, 40, 100, 0); tfstring1.setBounds(10, 65, 100, 20); submit.setBounds(10, 90, 210, 30); display.setBounds(10, 130, 210, 100); display.setEditable(false); add(lstring1); add(tfstring1); add(submit); add(display); submit.addActionListener(this); setTitle("String Operations"); setSize(230,240); setLayout(null); setVisible(true); addWindowListener(new WindowAdapter() {               public void windowClosing(WindowEvent e)             {      ...

8 A. Design a AWT program to print the factorial for an input value.

Program:   import java.awt.*; import java.awt.event.*; class Factorial extends Frame implements ActionListener { TextField tf; Button b; Label n, l, r; Factorial() {   n = new Label("AWT Factorial Program"); l = new Label("Enter number"); r = new Label(); tf = new TextField(); b = new Button("Factorial");   n.setBounds(30, 40, 200, 20); l.setBounds(30, 70, 150, 20); r.setBounds(30, 170, 200, 20); tf.setBounds(30, 90, 190, 30); b.setBounds(30, 130, 190, 30);   add(n); add(l); add(r); add(tf); add(b); setSize(250,210); setLayout(null);//no layout manager   setVisible(true);//now frame will be visible, by default not visible   b.addActionListener(this); addWindowListener(new WindowAdapter() {               public void windowClosing(WindowEvent e)     ...