<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
		<id>http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Maple_Lesson_10_-_Light_indicator%22</id>
		<title>Maple Lesson 10 - Light indicator&quot; - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Maple_Lesson_10_-_Light_indicator%22"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Maple_Lesson_10_-_Light_indicator%22&amp;action=history"/>
		<updated>2026-04-21T11:07:15Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Maple_Lesson_10_-_Light_indicator%22&amp;diff=3936&amp;oldid=prev</id>
		<title>Jasonsheng：Created page with &quot;{| style=&quot;width: 800px;&quot; |- | ==Objective== In photoresistance experiment, the light is divided into two levels, strong or weak. This experiment will finish a light indictor u...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Maple_Lesson_10_-_Light_indicator%22&amp;diff=3936&amp;oldid=prev"/>
				<updated>2014-08-24T13:20:48Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| style=&amp;quot;width: 800px;&amp;quot; |- | ==Objective== In photoresistance experiment, the light is divided into two levels, strong or weak. This experiment will finish a light indictor u...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| style=&amp;quot;width: 800px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
==Objective==&lt;br /&gt;
In photoresistance experiment, the light is divided into two levels, strong or weak. This experiment will finish a light indictor using&lt;br /&gt;
4 LEDs and divides the light into 5 levels. Photoresistance receives the lighter, and light up more LED to achieve the purpose of instruction.&lt;br /&gt;
==Equipment==&lt;br /&gt;
*[[ Microduino-CoreSTM32]]&lt;br /&gt;
Microduino-CoreSTM32 is an ARM development board using STM32F103CBT6 chip. It use special Upin7 interface, the size is similar with a coin and fully compatible other Microduino modules.&lt;br /&gt;
*Other hardware equipment&lt;br /&gt;
**Breadboard Jumper            one box   &lt;br /&gt;
**Breadboard  	               one piece  &lt;br /&gt;
**Photoresistance              one&lt;br /&gt;
**LED Light-emitting diodes    four &lt;br /&gt;
**220Ω                         four&lt;br /&gt;
**10k resistor 	               one &lt;br /&gt;
**USB Data cable               one&lt;br /&gt;
&lt;br /&gt;
[[File:stm32-lesson11All.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Schematic==&lt;br /&gt;
[[File:stm32-lesson11-Principle.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
The photoresistance's connection in contrast to the last time, the purpose is let you know the usage of photoresistance deeply.&lt;br /&gt;
photoresistance directly connects to the power supply at one end, the other end through a resistance to connect GND .&lt;br /&gt;
The initial state is low and with the increase of light intensity voltage is higher and higher.&lt;br /&gt;
&lt;br /&gt;
==Program==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
const int analogInPin = 14;&lt;br /&gt;
const int ledPin = 4;&lt;br /&gt;
&lt;br /&gt;
float sensorValue = 0;        // value read from the pot&lt;br /&gt;
&lt;br /&gt;
int xl=4000; //This is the basic environmental brightness variables, please check your own brightness values, fill out here is slightly greater than the measured value of the data but the data is less than the light&lt;br /&gt;
&lt;br /&gt;
void setup() {&lt;br /&gt;
  pinMode(analogInPin, INPUT);&lt;br /&gt;
  for(int i=3; i&amp;lt;=6;i++)          //Set the I/O port 2 - 5 to output mode.&lt;br /&gt;
  {&lt;br /&gt;
    pinMode(i,OUTPUT);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop() {&lt;br /&gt;
  // read the analog in value:&lt;br /&gt;
  sensorValue = analogRead(analogInPin);&lt;br /&gt;
  &lt;br /&gt;
if (sensorValue&amp;gt;=1000)             &lt;br /&gt;
  {&lt;br /&gt;
    digitalWrite(3,HIGH);&lt;br /&gt;
    digitalWrite(3,LOW);&lt;br /&gt;
  }&lt;br /&gt;
  if(sensorValue&amp;gt;1500)&lt;br /&gt;
   {&lt;br /&gt;
    digitalWrite(4,HIGH);&lt;br /&gt;
    digitalWrite(4,LOW);&lt;br /&gt;
  }&lt;br /&gt;
    if(sensorValue&amp;gt;2000)&lt;br /&gt;
   {&lt;br /&gt;
     digitalWrite(5,HIGH);&lt;br /&gt;
     digitalWrite(5,LOW);&lt;br /&gt;
  }&lt;br /&gt;
    if(sensorValue&amp;gt;2500)&lt;br /&gt;
   {&lt;br /&gt;
     digitalWrite(6,HIGH);&lt;br /&gt;
     digitalWrite(6,LOW);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  SerialUSB.print(&amp;quot;sensorValue = &amp;quot;);&lt;br /&gt;
  SerialUSB.println(sensorValue);&lt;br /&gt;
  delay(500);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Result==&lt;br /&gt;
When the light is very weak, lower the set minimum value, all the lights are off. With the increase of light, reach to a set level would light up an LED, to achieve the effect of instruction. Actually LED lamp has been flashing, because in order to make the light intensity is not a certain level, to put out the light of the level, directly after the lights out immediately, with no delay in the implementation process, as long as the grade, circulation processing, so it looks as if always on.[[File:stm32-lesson11Result.jpg|600px|center|thumb]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jasonsheng</name></author>	</entry>

	</feed>