Showing posts with label Remote. Show all posts
Showing posts with label Remote. Show all posts
Thursday, September 24, 2015
Tuesday, April 2, 2013
Điều chỉnh độ sáng tối bóng đèn bằng remote tivi Sony dùng vi điều khiển pic12f683
Sơ đồ nguyên lý:
Code viết bằng ngôn ngữ Mikroc:
The code devided into 2 parts, AC chopper for light dimming control and SIRC decoding for input remote control. As I mention earlier, the SIRC decoding part is on my previous example. For dimming control, GP3 is setup as interrupt-on-change, that's mean INTCON.GPIF is set every zero-crossing is dectected, then microcontroller performs delay by using the Timer1 then activates the triac.
#define tx GPIO.GP5
unsigned TMR1 absolute 0x0E;
char current_dim = 0;
char done_flag = 0;
//preload timer1 value 100%, 90%, 80%, 70% 60%, 50%, 40%, 30% 20% and 10%
unsigned preload_time[10] = {65535,63823,63082,62481,61925,61370,60814,\
60259,59656,58916};
//************************************************** ****************************
//*** interrupt-on-change when zero-crossing occur, preload timer1 value
//*** turn on timer1 to perform delay before gate trigger
//************************************************** ****************************
if(INTCON.GPIF){
tx = 1;
TMR1 = preload_time[current_dim];//preload_time into Timer1
T1CON.TMR1ON = 1; //start timer1
INTCON.GPIF = 0;
}
//************************************************** ****************************
//*** perform gate trigger, turn off itself
//************************************************** ****************************
if(PIR1.TMR1IF){
T1CON.TMR1ON = 0; //stop timer1
tx = 0; //turn on triac
delay_us(150);
tx = 1; //turn off triac
PIR1.TMR1IF = 0; //clear interrupt flag
}
}
At 60 Hz AC power line, one circle is 16.6667 milliseconds, half circle is 8.333 milliseconds. If the microcontroller delay 4166 us before activate the triac on both side, positive and negative, then the light bulb would have half of the power. In this project, the 8.333ms is divided into 10 steps for the power control by calculation then put it into preload_time variable. The program decode SIRC VOL+ key for step up and VOL- key for step down(dim) by changeing current_dim variable.
if(done_flag == 0){
if(got_data){
Command_code = input_data & 0x7F;
Device_code = input_data >> 7;
if(Device_code == 1){
switch (Command_code){
case 0x12: if(current_dim > 0) current_dim --;
break;
case 0x13: if(current_dim < 9) current_dim ++;
break;
}
}
done_flag = 1;
}
}
Nguồn: http://www.pic_examples.byethost3.com/
Tuesday, November 13, 2012
Lập trình điều khiển thiết bị bằng remote tivi sony - Chuẩn RC5
Ở project này dientudieukhien.net chia sẽ cùng bạn cách lập trình giải mã tín hiệu được mã hóa bởi remote tivi theo chuẩn RC5, ở đây mình sử dụng remote tivi sony.
![]() |
| Giải mã remote tivi chuẩn RC5 |
Video minh họa:
|| Tải code in mikroc
-
Trao đổi liên kết
-
Kiếm tiền online thật đơn giản với Donkeymails
-
wire symbols
-
Resistor symbols
-
Phần mềm phổ biến
-
Swich symbols
-
Tích hợp Ghost32.7z vào trong Hiren's boot 15.xx
-
CircuitLab Editor phần mềm vẽ mạch và mô phỏng online
-
Khóa cửa điện tử mở cửa bằng password sử dụng vi điều khiển pic 16f887
-
Tạo một ký tự đặc biệt cho LCD bằng Mikroc
Popular Posts
tab
Từ khóa truy cập nhanh
Audio
Blogspot
Charger
Chuyên trang ĐT và PC
Ebook
Font chữ
Games
Icon và Wallpaper
Make money online
Microsoft word
Món ngon dễ làm
Mạch điện tử thú vị
Mạng máy tính
Mạng xã hội
Office excel
Photoshop
Power supply
PowerPoint
Softwaves
Symbol electronic
Theme Blogspot
Thủ thuật máy tính
Thủ thuật office
Tài liệu truyền hình
Tài liệu điện tử
Vector image
Vi điều khiển 8051
Vi điều khiển Pic
Điện tử cơ bản



Facebook
Twitter
Google+
Rss Feed

