Ic unit Ambient light
Ic unit Ambient light
Hallo,
Ik wil een ambient light maken voor mijn pc met behulp van mijn arduino uno.
Daar heb ik een ULN2003A ic unit voor nodig.
Maar nou heb ik een ULN2003AN unit gekocht.
Zit hier verschil in?
Groet
Frank
Ik wil een ambient light maken voor mijn pc met behulp van mijn arduino uno.
Daar heb ik een ULN2003A ic unit voor nodig.
Maar nou heb ik een ULN2003AN unit gekocht.
Zit hier verschil in?
Groet
Frank
-
- Moderator
- Berichten: 11503
- Lid geworden op: wo 10 dec 2003, 18:36
- Locatie: nederweert. .. .. .. .. .. .. .. .. .
Weet iemand misschien wat ik fout doe?
Ik krijg het spulletje maar niet aan de praat
Excuses voor amateuristische aansluitingen.
Ik heb het concept van deze website opgevolgd
http://siliconrepublic.blogspot.nl/2011 ... hting.html
Ik krijg het spulletje maar niet aan de praat
Excuses voor amateuristische aansluitingen.
Ik heb het concept van deze website opgevolgd
http://siliconrepublic.blogspot.nl/2011 ... hting.html
Laatst gewijzigd door Diabe op wo 3 dec 2014, 21:10, 1 keer totaal gewijzigd.
Hier nogmaals een poging tot de foto's
<a href="http://www.imageupload.co.uk/5ltT"><img src="http://www.imageupload.co.uk/images/201 ... to_1_8.jpg" alt="foto_1_8.jpg" border="0"></a>
<a href="http://www.imageupload.co.uk/5lt0"><img src="http://www.imageupload.co.uk/images/201 ... to_2_8.jpg" alt="foto_2_8.jpg" border="0"></a>
<a href="http://www.imageupload.co.uk/5ltA"><img src="http://www.imageupload.co.uk/images/201 ... to_3_8.jpg" alt="foto_3_8.jpg" border="0"></a>
<a href="http://www.imageupload.co.uk/5ltT"><img src="http://www.imageupload.co.uk/images/201 ... to_1_8.jpg" alt="foto_1_8.jpg" border="0"></a>
<a href="http://www.imageupload.co.uk/5lt0"><img src="http://www.imageupload.co.uk/images/201 ... to_2_8.jpg" alt="foto_2_8.jpg" border="0"></a>
<a href="http://www.imageupload.co.uk/5ltA"><img src="http://www.imageupload.co.uk/images/201 ... to_3_8.jpg" alt="foto_3_8.jpg" border="0"></a>
-
- Moderator
- Berichten: 11503
- Lid geworden op: wo 10 dec 2003, 18:36
- Locatie: nederweert. .. .. .. .. .. .. .. .. .
Zien jullie helemaal niks van de foto's?
Of zijn ze abnormaal groot ?
Poging #3:
http://i61.tinypic.com/261koph.jpg
http://i62.tinypic.com/2vvvqcl.jpg
http://i57.tinypic.com/xlj85k.jpg
Of zijn ze abnormaal groot ?
Poging #3:
http://i61.tinypic.com/261koph.jpg
http://i62.tinypic.com/2vvvqcl.jpg
http://i57.tinypic.com/xlj85k.jpg
-
- Moderator
- Berichten: 11503
- Lid geworden op: wo 10 dec 2003, 18:36
- Locatie: nederweert. .. .. .. .. .. .. .. .. .
-
- Moderator
- Berichten: 1881
- Lid geworden op: di 24 mar 2009, 12:23
- Locatie: prov Groningen.. .. .. .. .. .. .. .
Je kunt de arduino testen door de standaard led knipper sketch te gebruiken. Als je de outputs aanpast moet je de uln er ook mee kunnen aansturen.
Heb je de gnd van de arduino wel aan de gnd van de uln zitten?
Heb je de gnd van de arduino wel aan de gnd van de uln zitten?
Hoe zorgvuldiger je als topicstarter je probleem omschrijft, hoe meer kans op adequate reacties en een oplossing.
-
- Moderator
- Berichten: 11503
- Lid geworden op: wo 10 dec 2003, 18:36
- Locatie: nederweert. .. .. .. .. .. .. .. .. .
-
- Moderator
- Berichten: 11503
- Lid geworden op: wo 10 dec 2003, 18:36
- Locatie: nederweert. .. .. .. .. .. .. .. .. .
Deze in het programma processing:
//Developed by Rajarshi Roy
import java.awt.Robot; //java library that lets us take screenshots
import java.awt.AWTException;
import java.awt.event.InputEvent;
import java.awt.image.BufferedImage;
import java.awt.Rectangle;
import java.awt.Dimension;
import processing.serial.*; //library for serial communication
Serial port; //creates object "port" of serial class
Robot robby; //creates object "robby" of robot class
void setup()
{
port = new Serial(this, Serial.list()[0],9600); //set baud rate
size(100, 100); //window size (doesn't matter)
try //standard Robot class error check
{
robby = new Robot();
}
catch (AWTException e)
{
println("Robot class not supported by your system!");
exit();
}
}
void draw()
{
int pixel; //ARGB variable with 32 int bytes where
//sets of 8 bytes are: Alpha, Red, Green, Blue
float r=0;
float g=0;
float b=0;
//get screenshot into object "screenshot" of class BufferedImage
BufferedImage screenshot = robby.createScreenCapture(new Rectangle(new Dimension(1368,928)));
//1368*928 is the screen resolution
int i=0;
int j=0;
//1368*928
//I skip every alternate pixel making my program 4 times faster
for(i =0;i<1368; i=i+2){
for(j=0; j<928>>16)); //add up reds
g = g+(int)(255&(pixel>>8)); //add up greens
b = b+(int)(255&(pixel)); //add up blues
}
}
r=r/(684*464); //average red (remember that I skipped ever alternate pixel)
g=g/(684*464); //average green
b=b/(684*464); //average blue
port.write(0xff); //write marker (0xff) for synchronization
port.write((byte)(r)); //write red value
port.write((byte)(g)); //write green value
port.write((byte)(b)); //write blue value
delay(10); //delay for safety
background(r,g,b); //make window background average color
}
En deze in arduino:
//Developed by Rajarshi Roy
int red, green, blue; //red, green and blue values
int RedPin = 9; //Red pin 9 has a PWM
int GreenPin = 10; //Green pin 10 has a PWM
int BluePin = 11; //Blue pin 11 has a PWM
void setup()
{
Serial.begin(9600);
//initial values (no significance)
int red = 255;
int blue = 255;
int green = 255;
}
void loop()
{
//protocol expects data in format of 4 bytes
//(xff) as a marker to ensure proper synchronization always
//followed by red, green, blue bytes
if (Serial.available()>=4) {
if(Serial.read() == 0xff){
red = Serial.read();
green= Serial.read();
blue = Serial.read();
}
}
//finally control led brightness through pulse-width modulation
analogWrite (RedPin, red);
analogWrite (GreenPin, green);
analogWrite (BluePin, blue);
delay(10); //just to be safe
}
//Developed by Rajarshi Roy
import java.awt.Robot; //java library that lets us take screenshots
import java.awt.AWTException;
import java.awt.event.InputEvent;
import java.awt.image.BufferedImage;
import java.awt.Rectangle;
import java.awt.Dimension;
import processing.serial.*; //library for serial communication
Serial port; //creates object "port" of serial class
Robot robby; //creates object "robby" of robot class
void setup()
{
port = new Serial(this, Serial.list()[0],9600); //set baud rate
size(100, 100); //window size (doesn't matter)
try //standard Robot class error check
{
robby = new Robot();
}
catch (AWTException e)
{
println("Robot class not supported by your system!");
exit();
}
}
void draw()
{
int pixel; //ARGB variable with 32 int bytes where
//sets of 8 bytes are: Alpha, Red, Green, Blue
float r=0;
float g=0;
float b=0;
//get screenshot into object "screenshot" of class BufferedImage
BufferedImage screenshot = robby.createScreenCapture(new Rectangle(new Dimension(1368,928)));
//1368*928 is the screen resolution
int i=0;
int j=0;
//1368*928
//I skip every alternate pixel making my program 4 times faster
for(i =0;i<1368; i=i+2){
for(j=0; j<928>>16)); //add up reds
g = g+(int)(255&(pixel>>8)); //add up greens
b = b+(int)(255&(pixel)); //add up blues
}
}
r=r/(684*464); //average red (remember that I skipped ever alternate pixel)
g=g/(684*464); //average green
b=b/(684*464); //average blue
port.write(0xff); //write marker (0xff) for synchronization
port.write((byte)(r)); //write red value
port.write((byte)(g)); //write green value
port.write((byte)(b)); //write blue value
delay(10); //delay for safety
background(r,g,b); //make window background average color
}
En deze in arduino:
//Developed by Rajarshi Roy
int red, green, blue; //red, green and blue values
int RedPin = 9; //Red pin 9 has a PWM
int GreenPin = 10; //Green pin 10 has a PWM
int BluePin = 11; //Blue pin 11 has a PWM
void setup()
{
Serial.begin(9600);
//initial values (no significance)
int red = 255;
int blue = 255;
int green = 255;
}
void loop()
{
//protocol expects data in format of 4 bytes
//(xff) as a marker to ensure proper synchronization always
//followed by red, green, blue bytes
if (Serial.available()>=4) {
if(Serial.read() == 0xff){
red = Serial.read();
green= Serial.read();
blue = Serial.read();
}
}
//finally control led brightness through pulse-width modulation
analogWrite (RedPin, red);
analogWrite (GreenPin, green);
analogWrite (BluePin, blue);
delay(10); //just to be safe
}