Cov txheej txheem:

Ntoo LED Moos - Cov Qauv Sib Xws: 11 Kauj Ruam (nrog Duab)
Ntoo LED Moos - Cov Qauv Sib Xws: 11 Kauj Ruam (nrog Duab)

Video: Ntoo LED Moos - Cov Qauv Sib Xws: 11 Kauj Ruam (nrog Duab)

Video: Ntoo LED Moos - Cov Qauv Sib Xws: 11 Kauj Ruam (nrog Duab)
Video: Lub Zog Nruab Nrog (Hmong Dubbed) 2024, Hlis ntuj nqeg
Anonim
Ntoo LED Moos - Cov Qauv Zoo
Ntoo LED Moos - Cov Qauv Zoo

Nws yog qhov sib txawv style ntoo LED moos. Kuv tsis paub yog vim li cas kuv tsis tau pom ib qho ntawm no ua ntej.. txawm tias cov hom digital muaj ntau heev. Anyhoo, ntawm no peb mus!

Kauj ruam 1:

Duab
Duab
Duab
Duab

Lub phiaj xwm plywood tau pib ua txoj haujlwm pib yooj yim rau CNC router. Kuv tau saib cov phiaj xwm yooj yim online thiab pom lub teeb no (duab saum toj no). Kuv kuj tau pom cov moos uas ci los ntawm cov ntoo ntoo (duab saum toj no). Yog li, ua ke ob txoj haujlwm yog lub tswv yim pom tseeb. Nrhiav kev nyuaj rau kuv tus kheej, Kuv txiav txim siab tsis siv veneer tab sis tsuas yog ib qho ntoo rau qhov haujlwm no.

Kauj Ruam 2: Tsim

Tsim
Tsim
Tsim
Tsim

Kuv tsim lub moos hauv Inkscape (duab saum toj no). Tus tsim yog yooj yim heev los ntawm kev xaiv. Kuv tau txiav txim siab tawm tsam cov kab ib puag ncig rau cov xov hlau vim tias nyob rau lub sijhawm no kuv tsis paub yog tias kuv xav mus nrog cov xov hluav taws xob lossis ib puag ncig. (Kuv txiav txim siab mus nrog txoj kab thaiv ib puag ncig thaum kawg.) Ib qho neopixel mus rau hauv ib qho ntawm qhov ncig me me kom pom lub feeb thiab teev sijhawm, nrog rau tsib feeb meej. Lub voj voos nyob hauv nruab nrab yuav raug xa tawm kom haum rau cov khoom siv hluav taws xob.

Kauj ruam 3: CNCing

CNCing
CNCing
CNCing
CNCing
CNCing
CNCing
CNCing
CNCing

Kuv tsim cov cuab yeej cuab tam ntawm MasterCAM, thiab siv lub tshuab thev naus laus zis los zom lub moos los ntawm 3/4 nti plywood. Kuv siv daim 15 "x15" rau qhov no, nrog kev nkim me ntsis. Qhov ua kom yuam kev yog kom tshem tawm cov ntoo ntau li ntau tau yam tsis tau hla ntoo. Tawm 0.05 "-0.1" yog qhov kev xaiv zoo rau lub teeb ntoo. Yog tias koj tsis paub meej, nws zoo dua tso ntoo ntau ntxiv, vim tias koj tuaj yeem ua xuab zeb rau lwm lub ntsej muag. Kuv xaus qhov tshem me ntsis ntoo ntau dhau los ntawm qee qhov, tab sis ua tsaug qhov txiaj ntsig tsis txom nyem ntau vim qhov no.

Nco tseg rau cov neeg siv yam tsis tau nkag mus rau CNC:

Txoj haujlwm no tuaj yeem ua tiav tau yooj yim nrog lub laum xovxwm. Koj tsuas yog yuav tsum teeb tsa qhov chaw nres tsheb ntawm qhov chaw uas koj tawm ntawm 0.1 ntawm cov ntoo uas tseem tshuav ntawm lub hauv paus. Koj yuav tsum yog qhov tseeb, tab sis tsis yog qhov tseeb. tib lub sijhawm, yog li koj tuaj yeem khiav tawm nrog me ntsis nqes hav.

Kauj ruam 4: Electronics

Electronics
Electronics
Electronics
Electronics
Electronics
Electronics

Cov khoom siv hluav taws xob yooj yim heev. Muaj 24 neopixels, kaum ob rau qhia cov teev thiab kaum ob rau qhia cov feeb, nrog tsib feeb meej. Arduino pro mini tswj cov neopixels thiab nws tau txais lub sijhawm raug los ntawm DS3231 lub sijhawm teev sijhawm (RTC) qauv. RTC tus qauv muaj lub npib ntawm tes raws li thaub qab, yog li nws tsis poob sijhawm txawm tias lub hwj chim tawm.

Khoom siv:

Arduino pro mini (lossis lwm yam Arduino rau qhov teeb meem ntawd)

DS3231 breakout board

Neopixels nyob rau hauv tus kheej breakout boards

Kauj Ruam 5: Cov Khoom Siv Hluav Taws Xob

Electronics los ua ke
Electronics los ua ke
Electronics los ua ke
Electronics los ua ke
Electronics los ua ke
Electronics los ua ke
Electronics los ua ke
Electronics los ua ke

Kuv txuas cov neopixels hauv txoj hlua, siv 2.5 xov hlau rau thawj kaum ob lub leds thiab plaub-ntiv tes xaim rau kaum ob tom ntej no. Kuv tuaj yeem siv cov xov hlau me me me me. Kuv tau ntxiv qhov hloov pauv ib ntus kom qhib tag nrho cov leds, tsuas yog qhia tawm.

Kauj Ruam 6: Qhuav Qhuav

Qhuav Khiav
Qhuav Khiav
Qhuav Khiav
Qhuav Khiav
Qhuav Khiav
Qhuav Khiav
Qhuav Khiav
Qhuav Khiav

Tom qab sim, tso LEDs rau hauv lub qhov thiab tig lawv txhua qhov, Kuv txaus siab nrog cov txiaj ntsig. Yog li kuv tau xuab zeb pem hauv ntej lub ntsej muag me ntsis thiab siv lub tsho PU. Kuv tau xaum lub tsho ntev tom qab, tab sis nws yog lub tswv yim zoo kom tso nws yog tias koj tsis pom nws zoo nkauj zoo nkauj.

Kauj Ruam 7: Epoxy

Epoxy
Epoxy
Epoxy
Epoxy

Tom qab qee qhov kev sim nrog txoj haujlwm coj ua hauv lub qhov, Kuv xam pom tias kev sib tham zoo tshaj plaws tau ua tiav thaum LEDs nyob ib puag ncig 0.2 deb ntawm qhov kawg ntawm lub qhov. Thaum koj sim koj tus kheej no, qhov ci ntawm LEDs yuav txawv heev hauv Tsis txhob txhawj xeeb txog qhov no; peb yuav kho nws hauv qhov chaws. Qhov no yog vim hom laum me ntsis kuv tau siv. Tab sis, hauv txhua qhov xwm txheej, kom tau txais qhov nrug kuv tau sib xyaw qee cov epoxy thiab muab me ntsis rau hauv txhua lub qhov.

Kauj Ruam 8: Muab Nws Txhua Qhov Ua Ke

Muab Nws Tag Nrho Ua Ke
Muab Nws Tag Nrho Ua Ke
Muab Nws Tag Nrho Ua Ke
Muab Nws Tag Nrho Ua Ke
Muab Nws Tag Nrho Ua Ke
Muab Nws Tag Nrho Ua Ke
Muab Nws Tag Nrho Ua Ke
Muab Nws Tag Nrho Ua Ke

Cov LEDs yuav raug muab tso los ntawm 12 teev teev teev tes txav mus los ntawm lub moos los ntawm txhua lub sijhawm teev tes thiab tom qab ntawd mus rau feeb ib feeb, rov txav los ntawm 60 feeb cim txav mus los-clockwise. Qhov no yog li ntawd thaum peb saib los ntawm sab xub ntiag LED qauv zoo li mus raws lub moos.

Tom qab epoxy kho tau ib teev, kuv muab qee cov epoxy ntxiv. Lub sijhawm no, Kuv tso cov LEDs rau hauv lub qhov, ua kom ntseeg tau tias yuav npog cov xov hlau thiab cov laug txuas nrog cov epoxy. Qhov no ua rau pom lub teeb ci zoo thiab ruaj ntseg cov xov hlau.

Kauj ruam 9: Code

Code
Code

Cov cai nyob ntawm GitHub, xav tias dawb los hloov nws rau koj siv. Thaum koj hloov ntawm txhua lub LEDs rau tib qib, qhov ci ntawm lub teeb ci los ntawm yuav txawv heev hauv txhua lub qhov. Qhov no yog vim qhov sib txawv tuab ntawm cov ntoo hauv lub qhov thiab qhov sib txawv ntawm qhov ntxoov ntxoo ntawm ntoo, Raws li koj tuaj yeem pom ntoo xim sib txawv me ntsis hauv kuv daim. Txhawm rau kho qhov sib txawv ntawm qhov ci ntsa iab, Kuv tau ua qhov sib piv ntawm qib coj ci ci. Thiab txo qhov ci ci ntawm LEDs ci dua. Nws yog txheej txheem sim thiab ua yuam kev thiab tuaj yeem siv sijhawm ob peb feeb, tab sis cov txiaj ntsig tau zoo tsim nyog nws.

plywoodClock.ino

// Plywood Moos
// Tus sau: tinkrmind
// Tus Cwj Pwm 4.0 International (CC BY 4.0). Koj muaj kev ywj pheej rau:
// Qhia tawm - theej thiab faib cov khoom siv hauv ib qho nruab nrab lossis hom ntawv
// Hloov kho - hloov kho, hloov pauv, thiab tsim cov khoom siv rau txhua lub hom phiaj, txawm tias ua lag luam.
// Huag!
#suav nrog
#suav nrog "RTClib.h"
RTC_DS3231 rtc;
#suav nrog "Adafruit_NeoPixel.h"
#ifdef _AVR_
#suav nrog
#ib
#definePIN6
Adafruit_NeoPixel strip = Adafruit_NeoPixel (60, PIN, NEO_GRB + NEO_KHZ800);
int teevPixel = 0;
int feebPixel = 0;
unsignedlong lastRtcCheck;
Txoj hlua inputString = ""; // txoj hlua tuav cov ntaub ntawv tuaj
boolean stringComplete = tsis tseeb; // seb txoj hlua puas tiav
int qib [24] = {31, 51, 37, 64, 50, 224, 64, 102, 95, 255, 49, 44, 65, 230, 80, 77, 102, 87, 149, 192, 67, 109, 68, 77; ib.
voidsetup () {
#ifndef ESP8266
thaum (! Serial); // rau Leonardo/Micro/Zero
#ib
// Qhov no yog rau Trinket 5V 16MHz, koj tuaj yeem tshem tawm peb kab no yog tias koj tsis siv Trinket
#if txhais (_AVR_ATtiny85_)
yog (F_CPU == 16000000) clock_prescale_set (clock_div_1);
#ib
// Xaus ntawm trinket tshwj xeeb code
Serial.begin (9600);
strip.begin ();
strip.show (); // Pib tag nrho cov pixels rau 'tawm'
yog (! rtc.begin ()) {
Serial.println ("Tsis tuaj yeem pom RTC");
thaum (1);
}
pinMode (2, INPUT_PULLUP);
// rtc.adjust (DateTime (F (_ DATE_), F (_ TIME_))));
yog (rtc.lostPower ()) {
Serial.println ("RTC poob lub zog, cia teem sijhawm!");
// kab ntawv hauv qab no teeb tsa RTC rau hnub tim & sijhawm uas cov duab kos no tau muab tso ua ke
rtc.adjust (DateTime (F (_ DATE_), F (_ TIME_))));
// Kab no teeb tsa RTC nrog hnub tim & sijhawm qhia meej, piv txwv li teeb tsa
// Lub Ib Hlis 21, 2014 ntawm 3 teev sawv ntxov koj yuav hu:
// rtc.adjust (DateTime (2017, 11, 06, 2, 49, 0));
}
// rtc.adjust (DateTime (2017, 11, 06, 2, 49, 0));
// lightUpEven ();
// thaum (1);
lastRtcCheck = 0;
}
voidloop () {
yog (millis () - lastRtcCheck> 2000) {
Hnub tim tam sim no = rtc.now ();
Serial.print (tam sim no teev (), DEC);
Serial.print (':');
Serial.print (tam sim no.minute (), DEC);
Serial.print (':');
Serial.print (now.second (), DEC);
Serial.println ();
showTime ();
lastRtcCheck = millis ();
}
yog (! digitalRead (2)) {
lightUpEven ();
}
yog (stringComplete) {
Serial.println (inputString);
yog (inputString [0] == 'l') {
Serial.println ("Qib");
lightUpEven ();
}
yog (inputString [0] == 'c') {
Serial.println ("Qhia sijhawm");
showTime ();
strip.show ();
}
yog (inputString [0] == '1') {
Serial.println ("Hloov ntawm txhua lub LEDs");
lightUp (strip. Color (255, 255, 255));
strip.show ();
}
yog (inputString [0] == '0') {
Serial.println ("Tshem tawm txoj hlua");
meej ();
strip.show ();
}
// #3, 255 yuav teeb tus lej 3 rau qib 255, 255, 255
yog (inputString [0] == '#') {
Txoj hlua temp;
temp = inputString.substring (1);
int pixNum = temp.toInt ();
temp = inputString.substring (inputString.indexOf (',') + 1);
int siv = temp.toInt ();
Serial.print ("Teeb");
Serial.print (pixNum);
Serial.print ("rau qib");
Serial.println (siv zog);
strip.setPixelColor (pixNum, strip. Color (siv tau, siv tau, siv tau));
strip.show ();
}
// #3, 255, 0, 125 yuav teeb tsa tus lej 3 rau qib 255, 0, 125
yog (inputString [0] == '$') {
Txoj hlua temp;
temp = inputString.substring (1);
int pixNum = temp.toInt ();
int rIndex = inputString.indexOf (',') + 1;
temp = inputString.substring (rIndex);
int rIntensity = temp.toInt ();
intgIndex = inputString.indexOf (',', rIndex + 1) + 1;
temp = inputString.substring (gIndex);
intgIntensity = temp.toInt ();
int bIndex = inputString.indexOf (',', gIndex + 1) + 1;
temp = inputString.substring (bIndex);
int bIntensity = temp.toInt ();
Serial.print ("Teeb");
Serial.print (pixNum);
Serial.print ("R rau");
Serial.print (rIntensity);
Serial.print ("G rau");
Serial.print (gIntensity);
Serial.print ("B rau");
Serial.println (bIntensity);
strip.setPixelColor (pixNum, strip. Color (rIntensity, gIntensity, bIntensity));
strip.show ();
}
yog (inputString [0] == 's') {
Txoj hlua temp;
teev teev, feeb;
temp = inputString.substring (1);
teev = temp.toInt ();
int rIndex = inputString.indexOf (',') + 1;
temp = inputString.substring (rIndex);
feeb = temp.toInt ();
Serial.print ("Qhia lub sijhawm:");
Serial.print (teev);
Serial.print (":");
Serial.print (feeb);
showTime (teev, feeb);
ncua (1000);
}
inputString = "" cov ntaub ntawv;
stringComplete = tsis tseeb;
}
// ncua (1000);
}
voidserialEvent () {
thaum (Serial.available ()) {
char inChar = (char) Serial.read ();
inputString += inChar;
yog (inChar == '\ n') {
stringComplete = tseeb;
}
ncua (1);
}
}
voidclear () {
rau (uint16_t kuv = 0; kuv <strip.numPixels (); kuv ++) {
strip.setPixelColor (i, strip. Color (0, 0, 0));
}
}
voidshowTime () {
Hnub tim tam sim no = rtc.now ();
hourPixel = tam sim no.hour () % 12;
feebPixel = (now.minute () / 5) % 12 + 12;
meej ();
// strip.setPixelColor (hourPixel, strip. Color (40 + 40 * qib [hourPixel], 30 + 30 * qib [hourPixel], 20 + 20 * qib [hourPixel]));
// strip.setPixelColor (minutePixel, strip. Color (40 + 40 * qib [minutePixel], 30 + 30 * qib [minutePixel], 20 + 20 * qib [minutePixel]));
strip.setPixelColor (hourPixel, strip. Color (qib [hourPixel], qib [hourPixel], qib [hourPixel]));
strip.setPixelColor (feebPixel, strip. Color (qib [minutePixel], qib [minutePixel], qib [minutePixel]));
// lightUp (strip. Color (255, 255, 255));
strip.show ();
}
voidshowTime (int teev, int feeb) {
hourPixel = teev % 12;
feebPixel = (feeb / 5) % 12 + 12;
meej ();
// strip.setPixelColor (hourPixel, strip. Color (40 + 40 * qib [hourPixel], 30 + 30 * qib [hourPixel], 20 + 20 * qib [hourPixel]));
// strip.setPixelColor (minutePixel, strip. Color (40 + 40 * qib [minutePixel], 30 + 30 * qib [minutePixel], 20 + 20 * qib [minutePixel]));
strip.setPixelColor (hourPixel, strip. Color (qib [hourPixel], qib [hourPixel], qib [hourPixel]));
strip.setPixelColor (feebPixel, strip. Color (qib [minutePixel], qib [minutePixel], qib [minutePixel]));
// lightUp (strip. Color (255, 255, 255));
strip.show ();
}
voidlightUp (uint32_t xim) {
rau (uint16_t kuv = 0; kuv <strip.numPixels (); kuv ++) {
strip.setPixelColor (kuv, xim);
}
strip.show ();
}
voidlightUpEven () {
rau (uint16_t kuv = 0; kuv <strip.numPixels (); kuv ++) {
strip.setPixelColor (i, strip. Color (qib , qib , qib ));
}
strip.show ();
}

saib rawplywoodClock.ino tuav nrog ❤ los ntawm GitHub

Kauj Ruam 10: Khoos Phis Tawj Lub Zeem Muag - Calibration

Khoos Phis Tawj Lub Zeem Muag - Calibration
Khoos Phis Tawj Lub Zeem Muag - Calibration
Khoos Phis Tawj Lub Zeem Muag - Calibration
Khoos Phis Tawj Lub Zeem Muag - Calibration

Kuv tau txiav txim siab xaiv kom tsis txhob siv veneer hauv txoj haujlwm no. Yog tias kuv muaj, ntoo tuab yuav zoo ib yam nyob rau pem hauv ntej ntawm txhua lub LEDs. Tab sis, vim tias kuv muaj qhov tuab tuab ntawm cov ntoo nyob rau pem hauv ntej ntawm txhua LED thiab vim tias xim ntoo sib txawv ntau heev ib yam, qhov ci ci LED sib txawv rau txhua LED. Txhawm rau ua kom txhua lub LED zoo li zoo ib yam qhov ci, Kuv tau tsim qhov ua kom zoo nkauj.

Kuv tau sau qee txoj cai ua haujlwm (ntawm GitHub) uas siv daim duab ntawm lub moos, thiab tshuaj xyuas qhov ci ntawm txhua LED nyob rau hauv lem. Nws tom qab ntawd sib txawv lub zog rau txhua LED los sim ua kom lawv txhua tus muaj qhov ci tib yam li cov dimmest LED. Tam sim no, Kuv paub qhov no yog overkill, tab sis kev tsim cov duab yog lom zem heev! Thiab, Kuv vam tias yuav txhim kho tus lej ntsuas ua lub tsev qiv ntawv.

Koj tuaj yeem pom qhov ci ci LED ua ntej thiab tom qab ntsuas hauv cov duab saum toj no.

calibrateDispllay.pde

importprocessing.video.*;
importprocessing.serial.*;
Serial myPort;
Capture yees duab;
finalint numLed = 24;
int ledNum = 0;
// koj yuav tsum muaj cov varables thoob ntiaj teb no los siv PxPGetPixelDark ()
int rDark, gDark, bDark, aDark;
int rLed, gLed, bLed, aLed;
int rOrg, gOrg, bOrg, aOrg;
int rTemp, gTemp, bTemp, aTemp;
PImage peb duab;
int runNumber = 0;
int acceptError = 3;
int ua tiav;
int numPixelsInLed;
ntev coj ncaj ncees;
int ledPower;
ntev targetIntensity = 99999999;
voidsetup () {
ua = newint [numLed];
numPixelsInLed = newint [numLed];
ledIntensity = newlong [numLed];
ledPower = newint [numLed];
rau (int kuv = 0; kuv <numLed; kuv ++) {
ledPower [kuv] = 255;
}
printArray (Serial.list ());
Txoj hlua portName = Serial.list () [31];
myPort = newSerial (qhov no, portName, 9600);
loj (640, 480);
video = newCapture (qhov no, dav, siab);
video.start ();
noStroke ();
tus ();
ncua (1000); // Tos rau serial chaw nres nkoj qhib
}
voiddraw () {
yog (video.available ()) {
yog tias ua (ua [ledNum] == 0) {
clearDisplay ();
ncua (1000);
video.read ();
duab (yees duab, 0, 0, dav, siab); // Kos lub vis dis aus webcam rau ntawm qhov screen
saveFrame ("cov ntaub ntawv/no_leds.jpg");
yog (runNumber! = 0) {
yog ((ledIntensity [ledNum] - targetIntensity)*100/targetIntensity> lees paubError) {
ledPower [ledNum] -= pow (0.75, runNumber)*100+1;
}
yog ((targetIntensity - ledIntensity [ledNum])*100/targetIntensity> lees paubError) {
ledPower [ledNum] += pow (0.75, runNumber)*100 +1;
}
yog (abs (targetIntensity - ledIntensity [ledNum])*100/targetIntensity <= txais tau yuam kev) {
ua [ledNum] = 1;
print ("Coj");
print (cojNum);
print ("ua tiav");
}
yog (ledPower [ledNum]> 255) {
ledPower [ledNum] = 255;
}
yog (ledPower [ledNum] <0) {
ledPower [ledNum] = 0;
}
}
setLedPower (ledNum, ledPower [ledNum]);
ncua (1000);
video.read ();
duab (yees duab, 0, 0, dav, siab); // Kos lub vis dis aus webcam rau ntawm qhov screen
ncua (10);
thaum (myPort.available ()> 0) {
int hauvByte = myPort.read ();
// luam tawm (char (inByte));
}
String imageName = "cov ntaub ntawv/";
imageName+= str (ledNum);
imageName += "_ coj.jpg";
saveFrame (npe lub npe);
Txoj hlua originalImageName = "data/org";
originalImageName+= str (ledNum);
originalImageName += ". jpg";
yog (runNumber == 0) {
saveFrame (originalImageName);
}
PImage noLedImg = loadImage ("cov ntaub ntawv/no_leds.jpg");
PImage ledImg = loadImage (imageName);
PImage originalImg = loadImage (originalImageName);
noLedImg.loadPixels ();
ledImg.loadPixels ();
originalImg.loadPixels ();
keeb kwm yav dhau (0);
loadPixels (); cov.
ledIntensity [ledNum] = 0;
numPixelsInLed [ledNum] = 0;
rau (int x = 0; x <width; x ++) {
rau (int y = 0; y <height; y ++) {
PxPGetPixelDark (x, y, noLedImg.pixels, dav);
PxPGetPixelLed (x, y, ledImg.pixels, dav);
PxPGetPixelOrg (x, y, originalImg.pixels, dav);
yog ((rOrg+gOrg/2+bOrg/3)-(rDark+gDark/2+bDark/3)> 75) {
ledIntensity [ledNum] = ledIntensity [ledNum]+(rLed+gLed/2+bLed/3) -(rDark+gDark/2+bDark/3);
rTemp = 255;
gTemp = 255;
bTemp = 255;
numPixelsInLed [ledNum] ++;
lwm yam {
rTemp = 0;
gTemp = 0;
Peb = 0;
}
PxPSetPixel (x, y, rTemp, gTemp, bTemp, 255, pixels, dav);
}
}
ledIntensity [ledNum] /= numPixelsInLed [ledNum];
yog (targetIntensity> ledIntensity [ledNum] && runNumber == 0) {
targetIntensity = ledIntensity [ledNum];
}
updatePixels (); cov
}
print (cojNum);
print (','); cov.
luam tawm (ledPower [ledNum]);
print (','); cov.
println (ledIntensity [ledNum]); cov.
ledNum ++;
yog (ledNum == numLed) {
int tiav = 0;
rau (int kuv = 0; kuv <numLed; kuv ++) {
donezo += ua tiav ;
}
yog (donezo == numLed) {
println ("Ua tiav");
rau (int kuv = 0; kuv <numLed; kuv ++) {
luam tawm (kuv);
print ("\ tau");
println (ledPower [kuv]);
}
print ("int qib [");
print (cojNum);
print ("] = {"); cov.
rau (int i = 0; kuv <numLed-1; i ++) {
print (ledPower [kuv]);
print (','); cov.
}
print (ledPower [numLed -1]);
println ("};"); cov.
lightUpEven ();
thaum (muaj tseeb);
}
print ("Lub hom phiaj siv:");
yog (runNumber == 0) {
targetIntensity -= 1;
}
println (targetIntensity);
ledNum = 0;
runNumber ++;
}
}
}
voidPxPGetPixelOrg (intx, inty, int pixelArray, intpixelsWidth) {
int thisPixel = pixelArray [x+y*pixelsWidth]; // tau txais cov xim raws li int los ntawm pixels
aOrg = (thisPixel >> 24) & 0xFF; // peb yuav tsum tau hloov pauv thiab npog lub ntsej muag kom tau txais txhua qhov ib leeg
rOrg = (thisPixel >> 16) & 0xFF; // qhov no nrawm dua li hu liab (), ntsuab (), xiav ()
gOrg = (thisPixel >> 8) & 0xFF;
bOrg = thisPixel & 0xFF;
}
voidPxPGetPixelDark (intx, inty, int pixelArray, intpixelsWidth) {
int thisPixel = pixelArray [x+y*pixelsWidth]; // tau txais cov xim raws li int los ntawm pixels
aDark = (thisPixel >> 24) & 0xFF; // peb yuav tsum tau hloov pauv thiab npog lub ntsej muag kom tau txais txhua qhov ib leeg
rDark = (thisPixel >> 16) & 0xFF; // qhov no nrawm dua li hu liab (), ntsuab (), xiav ()
gDark = (thisPixel >> 8) & 0xFF;
bDark = thisPixel & 0xFF;
}
voidPxPGetPixelLed (intx, inty, int pixelArray, intpixelsWidth) {
int thisPixel = pixelArray [x+y*pixelsWidth]; // tau txais cov xim raws li int los ntawm pixels
aLed = (thisPixel >> 24) & 0xFF; // peb yuav tsum tau hloov pauv thiab npog lub ntsej muag kom tau txais txhua qhov ib leeg
rLed = (thisPixel >> 16) & 0xFF; // qhov no nrawm dua li hu liab (), ntsuab (), xiav ()
gLed = (thisPixel >> 8) & 0xFF;
bLed = thisPixel & 0xFF;
}
voidPxPSetPixel (intx, inty, intr, intg, intb, inta, int pixelArray, intpixelsWidth) {
ib = (a << 24);
r = r << 16; // Peb tau ntim tag nrho 4 qhov sib xyaw ua ke rau hauv ib qho
g = g << 8; // yog li peb yuav tsum hloov lawv mus rau lawv qhov chaw
xim argb = a | r | ib g | xoj b; // binary "lossis" kev ua haujlwm ntxiv lawv tag nrho rau hauv ib qho int
pixelArray [x+y*pixelsWidth] = argb; // qhov kawg peb teeb tsa int nrog te xim rau hauv pixels
}

saib rawcalibrateDispllay.pde tuav nrog ❤ los ntawm GitHub

Kauj Ruam 11: Tshaj Tawm Cov Lus Cim

Pitfalls kom zam:

* Nrog ntoo, koj tau txais yam koj them rau. Yog li, tau ntoo zoo. Birch plywood yog qhov kev xaiv zoo; txhua lub teeb ntoo yuav ua kom zoo ib yam thiab. Kuv pheej yig tawm ntawm cov ntoo thiab khuv xim kuv qhov kev txiav txim siab.

* Nws zoo dua los laum tsawg dua. Ob peb lub qhov mus tob dhau rau kuv daim. Thiab epoxy qhia los ntawm lub ntsej muag pem hauv ntej. Nws yog qhov pom tau heev thaum koj pom nws.

* Siv lub pob kawg laum me ntsis hloov qhov ncaj. Kuv tsis tau sim nrog lub pob kawg me ntsis, tab sis kuv paub zoo tias cov txiaj ntsig yuav zoo dua.

Kuv tab tom yaum nrog lub tswv yim ntawm kev muag cov no ntawm Etsy lossis tindie. Kuv yuav txaus siab rau nws yog tias koj tuaj yeem tawm tswv yim hauv qab no yog tias koj xav tias nws tsim nyog:)

Pom zoo: