*
  Мысли   Галерея   Проекты   Тексты  
  Мысли   Галерея   Проекты   Тексты  
Giver: flip/flop  (2014-10-21 21:27:23)

На самом деле можно сделать многие дома значительно удобнее причем для этого не нужно дорогостоящих деталей, сложных схем и микроконтроллеров. Выход программ в реальный мир отлично реализуется через двенадцативольтовое реле. Просто пример. Подключаем катушку реле напрямую к блоку питания компьютера (например, в наверняка гуляющий разъем флопика) и врезаем его в сетевой пилот. После чего этот пилот будет включен только при включенном компьютере, а значит ночью больше не будет толпы мигающих мониторов и гудящих колонок.

Но чтобы сделать наш полоумный дом еще чуточку полоумнее, и управлять программно техникой нужно чуточку больше усилий.

В интернете очень много разных вариантов как подключить периферию через COM и LPT порты, но, что интересно, кроме реле в них участвует набор самых разнообразных деталей, пара-тройка резисторов, конденсатор, тройка диодов, пара транзисторов. Я не совсем понимаю зачем это все и почему нет такой вот простой схемы на просторах. Паяется и собирается из любого подножного мусора, единственно транзистор нужен NPN типа, как видно из схемы. Диод можно и не свето-, естественно. На один COM-порт можно навесить минимум 2 такие схемы, на DTR (пин 4) и RTS (пин 7).

Под этим вашим линуксом управляется еще проще чем паяется. Пример для DTR(прим К.O.: чтобы управлять RTS, нужно DTR заменить на RTS)

#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
 
int main(void) {
    int status = 0, fd;
    if((fd = open("/dev/ttyS0", O_RDWR)) < 0) exit(1); // открываем последовательный порт.
    do {
        ioctl(fd, TIOCMGET, &status); // читаем текущее состояние
        printf("DTR is %dn", (status & TIOCM_DTR)); // выводим на экран
        status ^= TIOCM_DTR; // инвертируем значение линии 
        sleep(1); // ждем секунду
        ioctl(fd, TIOCMSET, &status); // записываем инвертированное значение
    } while(1); // смыть, повторить.
}


dobsonz от 2020-10-18 18:36:00:
dTTvnx http://pills2sale.com/ levitra nizagara
Lowell от 2020-10-26 09:32:38:
Please call back later what is tamsulosin 0.4 mg used for Under the structure the company envisions, Alibaba'sshareholders would still have the ability to approve or rejectall the directors. But the structure would prevent an activistinvestor from ever taking control of the board by nominating amajority of directors.
Micheal от 2020-10-26 09:32:38:
Not in at the moment celexa for ocd treatment In a lawsuit filed last week, the Jensens blamed aCalifornia-based food safety audit firm, Primus Group Inc, thatapproved the cleaning operation. The Jensens, who have said theywere saddened by the outbreak, said they will donate to thevictims any money they recover from the lawsuit. The brothersare due to be sentenced in January. (Writing by Tim Gaynor; Editing by Cynthia Johnston and AndreGrenon)
Adrian от 2020-10-26 09:32:38:
What do you want to do when you've finished? perlelux cream amazon “It’s gonna feel good to finish. It’s been a life-long mission,” he said. “I’m pretty excited about getting it over with. It’s been great for me, mentally and physically.”
Kermit от 2020-10-26 09:32:38:
I'd like to open a personal account abilify generic cost But after agencies reported they were nowhere close to meeting the October 1 goal set by Congress for having the insider threat-detections systems installed and operational, Congress pushed back the deadline.
Jerry от 2020-10-26 09:32:39:
I wanted to live abroad cozaar coupon merck "We would much prefer a big comprehensive bill, buy way that the House can get there is okay by us," Schumer told CNN. "If we can get together at the end of the day and compromise that will be a good thing."
Kylie от 2020-10-26 10:10:25:
I'm sorry, he's paxil or zoloft for pmdd In the 2014 calendar from the Italian spirits brand, each month will honor a certain culture and its signature holidays and celebrations. Rather than an everyday reference, this calendar is above all an artistic creation, sold in limited edition to collectors worldwide.
Austin от 2020-10-26 10:10:25:
I work with computers canine meloxicam The Milwaukee Journal Sentinel now is offering JS Everywhere, a new digital subscription package, which gives you unlimited access to JSOnline, the daily e-Edition, Journal Sentinel mobile site and content previously included in Packer Insider. Also coming soon, an iPad tablet app will be part of JS Everywhere.
Douglass от 2020-10-26 10:10:25:
I'm interested in this position curvimax review In one Art Camping project, "Texture of the city we lost," residents have created pencil rubbings of ordinary objects, street tiles and portions of building facades — all items that have faced destruction.
Sebastian от 2020-10-26 10:10:26:
I'd like to change some money price of prescription drugs in northern ireland Rogers - along with Canada's other major national telecoms BCE Inc and Telus Corp - argue that Verizonwould unfairly benefit from the policies to stimulatecompetition. Those policies include a 2012 easing ofrestrictions on foreign ownership for smaller operators.