PIC Project: LED Running Light


LED Running Light mempunyai 24 LED, 1 push button dan 1 variable resistor. LED Running Light boleh diprogram dengan pelbagai jenis nyalaan, apa saja projek-projek berkaitan seperti LED blinking, Knight Rider ataupun Traffic Light.

Skematiknya adalah seperti berikut.

PCB komponen layout nya adalah seperti berikut.

Senarai komponen projek LED Running Light seperti berikut.
No Component Label Unit
1 008 PCB PIC LED Running Light (98mm X 74mm) PCB 1
2 Capacitor Ceramic 0.1uF C3 1
3 Capacitor Electrolytic 10uF C1-C2 2
4 DC Jack Female DC Jack Female 1
5 Diode 1N4001 D1 1
6 IC PIC16F1939 DIP PIC16F1939 1
7 IC Socket 40pin PIC16F1939 1
8 LED Green 5mm LED17-LED24 8
9 LED Red 5mm LED1-LED8 8
10 LED Yellow 5mm LED9-LED16 8
11 PCB Stand (screw nut) PCB Stand 4
12 Push Button 4 pin 6x6x1 PB1 1
13 Resistor 0.25W 1K R25 1
14 Resistor 0.25W 330 R1-R24 24
15 Right Angle Pin Header (Male) ICSP 1
16 Slide Switch S1 1
17 Terminal Block 2 Way PWR 1
18 Variable Resistor (Preset) 1K R26 1
19 Voltage Regulator 5V TO220 7805 1

Harga projek LED Running Light adalah RM100 tidak termasuk bantuan teknikal. Di bawah adalah cara projek ini berfungsi.

PIC Source Code

Sertai Telegram Group bagi dapatkan source code


43 responses to “PIC Project: LED Running Light”

  1. dalam programming….saya nak tanya…apa beza void main() dengan void main(void)….kadang2 , cth lain,,
    void intterupt( kalau ada tulis something dalam bracket ni)…apa maksud dia…boleh tak contoh dan terangkan maksud dia?thanks

  2. Oh sorry..didnt realise got the potentiometer there

    Okay..sure..I will learn it..but I cant really make a simple ADC circuit la 🙁

  3. When I compiled the source code, I got the following error:
    HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.83
    Copyright (C) 2011 Microchip Technology Inc.
    Serial number: HCPICP-654321 (PRO)
    LibraryADC.h: read_a2d()
    11: if(channel<=7) ANSEL=ANSEL|(0b00000001<<channel);
    ^ (192) undefined identifier "ANSEL"
    12: else ANSELH=ANSELH|(0b00000001<<(channel-8));
    ^ (192) undefined identifier "ANSELH"
    run-led.c: pic_init()
    844: ANSEL=0b00000000;
    ^ (192) undefined identifier "ANSEL"
    845: ANSELH=0b00000000;
    ^ (192) undefined identifier "ANSELH"
    (908) exit status = 1

    Should I define them directly? Thank you, Shahrul. Your projects rock!

  4. program pada libraryPeripheral.h dan LibraryHardware.h
    adakah Library tersebut perlu dimodifikasi ataupun gunakan yang sedia ada??

  5. salam…saya suka dgn projek PIC nie…blh tak letak program utk PIC sekali…bb saya br belajar buat program PIC..ataupn email ke email sy untuk dijadikan contoh n tambah pengetahuan saya

  6. hello my friend please help me
    i have tried the above code but its not working for me showing so many errors
    please give me the hex file for pic16f877a
    if you want i can pay small amount to you.
    thank you

Leave a Reply to alip Cancel reply

Your email address will not be published. Required fields are marked *