SlideShare a Scribd company logo
1 of 5
Light Sensor
Facts: LDR is a type of light sensor which is
widely used to sense the amount of light.
8
Creating loop and Condition
9
⊹ The forever Block
repeat the code
continuously
forever.
⊹ We are also adding
a If condition and a
comparator to the if
statement, We’ll
giver or compare
our input values
here.
Inputs and working codes
10
⊹ Add a light level block.
⊹ The highest value we
get from the light sensor
is 225.
⊹ The light sensor is
present on the Top Left
where the number is
displayed.
👉
Adding outputs
11
⊹ For the comparator
sign value, calibrate
and set the value
according to your
surroundings.
⊹ Output – I’m adding a
simple show icon
feature you can control
different things and
make projects out of
this code itself.
12
Java script
basic.forever(function () {
if (input.lightLevel() < 100) {
basic.showLeds(`
# . # . #
. # # # .
# # # # #
. # # # .
# . # . #
`)
} else {
basic.showIcon(IconNames.Chessboard)
}
})

More Related Content

Similar to Light sensor

Arduino-2 (1).ppt
Arduino-2 (1).pptArduino-2 (1).ppt
Arduino-2 (1).pptHebaEng
 
Lily pad dev_handout
Lily pad dev_handoutLily pad dev_handout
Lily pad dev_handoutKhuê Phạm
 
Functional Programming in C#
Functional Programming in C#Functional Programming in C#
Functional Programming in C#Giorgio Zoppi
 
Lec 02 data representation part 2
Lec 02 data representation part 2Lec 02 data representation part 2
Lec 02 data representation part 2Abdul Khan
 
CIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.comCIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.comclaric130
 
Linear Block Codes
Linear Block CodesLinear Block Codes
Linear Block CodesNilaNila16
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshopatuline
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfssuser0e9cc4
 
Electronz_Chapter_12.pptx
Electronz_Chapter_12.pptxElectronz_Chapter_12.pptx
Electronz_Chapter_12.pptxMokete5
 
Angular 16 – the rise of Signals
Angular 16 – the rise of SignalsAngular 16 – the rise of Signals
Angular 16 – the rise of SignalsCoding Academy
 
Fading leds via pwm
Fading leds via pwmFading leds via pwm
Fading leds via pwmHIET
 
Electronz_Chapter_2.pptx
Electronz_Chapter_2.pptxElectronz_Chapter_2.pptx
Electronz_Chapter_2.pptxMokete5
 
Digital Logic Design basic gate and Logic Probe
Digital Logic Design basic gate and Logic ProbeDigital Logic Design basic gate and Logic Probe
Digital Logic Design basic gate and Logic ProbeAQCreations
 
CIS 115 Education for Service--cis115.com
CIS 115 Education for Service--cis115.com  CIS 115 Education for Service--cis115.com
CIS 115 Education for Service--cis115.com williamwordsworth10
 

Similar to Light sensor (20)

Arduino-2 (1).ppt
Arduino-2 (1).pptArduino-2 (1).ppt
Arduino-2 (1).ppt
 
Lily pad dev_handout
Lily pad dev_handoutLily pad dev_handout
Lily pad dev_handout
 
Object counter
Object counterObject counter
Object counter
 
Arduin0.ppt
Arduin0.pptArduin0.ppt
Arduin0.ppt
 
gesture
gesturegesture
gesture
 
Functional Programming in C#
Functional Programming in C#Functional Programming in C#
Functional Programming in C#
 
Lec 02 data representation part 2
Lec 02 data representation part 2Lec 02 data representation part 2
Lec 02 data representation part 2
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
 
Final Report
Final ReportFinal Report
Final Report
 
CIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.comCIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.com
 
Linear Block Codes
Linear Block CodesLinear Block Codes
Linear Block Codes
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdf
 
Electronz_Chapter_12.pptx
Electronz_Chapter_12.pptxElectronz_Chapter_12.pptx
Electronz_Chapter_12.pptx
 
Angular 16 – the rise of Signals
Angular 16 – the rise of SignalsAngular 16 – the rise of Signals
Angular 16 – the rise of Signals
 
Fading leds via pwm
Fading leds via pwmFading leds via pwm
Fading leds via pwm
 
Electronz_Chapter_2.pptx
Electronz_Chapter_2.pptxElectronz_Chapter_2.pptx
Electronz_Chapter_2.pptx
 
Digital Logic Design basic gate and Logic Probe
Digital Logic Design basic gate and Logic ProbeDigital Logic Design basic gate and Logic Probe
Digital Logic Design basic gate and Logic Probe
 
Project ir devices
Project ir devicesProject ir devices
Project ir devices
 
CIS 115 Education for Service--cis115.com
CIS 115 Education for Service--cis115.com  CIS 115 Education for Service--cis115.com
CIS 115 Education for Service--cis115.com
 

Recently uploaded

Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

Light sensor

  • 1. Light Sensor Facts: LDR is a type of light sensor which is widely used to sense the amount of light. 8
  • 2. Creating loop and Condition 9 ⊹ The forever Block repeat the code continuously forever. ⊹ We are also adding a If condition and a comparator to the if statement, We’ll giver or compare our input values here.
  • 3. Inputs and working codes 10 ⊹ Add a light level block. ⊹ The highest value we get from the light sensor is 225. ⊹ The light sensor is present on the Top Left where the number is displayed. 👉
  • 4. Adding outputs 11 ⊹ For the comparator sign value, calibrate and set the value according to your surroundings. ⊹ Output – I’m adding a simple show icon feature you can control different things and make projects out of this code itself.
  • 5. 12 Java script basic.forever(function () { if (input.lightLevel() < 100) { basic.showLeds(` # . # . # . # # # . # # # # # . # # # . # . # . # `) } else { basic.showIcon(IconNames.Chessboard) } })