Changes

From SensorKit X40 Wiki

Jump to: navigation, search

KY-027 Magic light cup module

254 bytes removed, 15:01, 12 May 2017
/* Code example Raspberry Pi */
==Code example Arduino==
It is an example program wich lights up the LED from Magic-Light Cup-module if the sensor detects gradient.
 
<pre class="brush:cpp">int Led = 13 ;// Declaration of the LED-output pin
int Sensor = 10; // Declaration of the sensor input pin
==Code example Raspberry Pi==
Program example in the language python
 
The LED will light up, in this example, if a signal will be detected.
 
<pre class="brush:py"># Needed modules will be imported and configured.
import RPi.GPIO as GPIO
'''Example program download'''
[http[Media://sensorkit.joy-it.net/images/c/cb/KY-027-RPi-MagicLightCup.zip |KY-027-RPi-MagicLightCup.zip]]
To start with , enter the command:
<pre class="brush:bash">sudo python KY-027-RPi-MagicLightCup.py
</pre>