Skip to content

Instantly share code, notes, and snippets.

View giljr's full-sized avatar
💭
Full Stack Developer with a degree in Computer Engineering.

Gilberto Oliveira Jr giljr

💭
Full Stack Developer with a degree in Computer Engineering.
View GitHub Profile
/* Project: Unit 02 - LCD
Code: unit_02_01_helloWorldLCD.c
Objective: In this project we will work with LCD;
How do you make text appears on lcd screen?
WELCOME TO LCD'S HELLO WORLD!
Note: Select on Library Manager the LCD library fo mokroC PRO for PIC:)
Author: mikroelektronica, edited by J3
/* Project: Unit 01 - IO
File: unit_01_11_UpDownCounter.c
Objective: While KEY_UP turn on all the PORTB LEDS;
While KEY DOWN turn off all PORTB LEDS, in a row:)
Author: microgenios, edited by J3
Date: Nov 2019
*/
/* Project: Unit 01 - IO
File: unit_01_10_ButtonFunction.c
Objective: Button Library - The Button Library provides routines for
detecting button presses and debouncing (eliminating the
influence of contact flickering upon pressing a button).
Note: Unable Button on mikkoc Pro for PIC's Library Manager
Prototype: unsigned short Button(unsigned short *port,
/* Project: Unit 01 - IO
File: unit_01_10_ButtonFunction.c
Objective: Button Library - The Button Library provides routines for
detecting button presses and debouncing (eliminating the
influence of contact flickering upon pressing a button).
Note: Unable Button on mikkoc Pro for PIC's Library Manager
Prototype: unsigned short Button(unsigned short *port,
/* Project: Unit 01 - IO
File: unit_01_09_WPUR.c
Objective: For PIC18F4520:
PORTB can be software programmed for internal weak pull-ups on all inputs
For PIC18F45K202:
Each of the PORTB pins has an individually controlled
weak internal pull-up. When set, each bit of the WPUB
register enables the corresponding pin pull-up. When
cleared, the RBPU bit of the INTCON2 register enables
/* Project: Unit 01 - IO
File: unit_01_08_RandomFlashing_LED.c
Objective: RANDOM FLASHING LEDS: The program uses a pseudorandom number generator to generate
a number between 0 and 32767. This number is then divided by 128 to limit it between 1 and 255.
The resultant number is sent to PORTB of the microcontroller. This process is repeated every second.
In this project 8 LEDs are connected to PORTB of a PIC18F452O microcontroller operated @ 8 MHz crystal.
NOTE: Enable C_Stdlib and C_Type libs on mikroC Pro for PIC's Library Manager \o/
/* Project: Unit 01 - IO
File: unit_01_07_ComplexFlashing_LED.c
Objective: COMPLEX FLASHING LED: The program flashes the LED connuously with
the following pattern: 3 flashes with 200 ms delay between each flash 2 s delay;
the result closely resemble a red flashing lights from an ambulance or fire engine;
this project an LEDs is connected to port pin RB0 of a PIC18F4520 microcontroller
operated from an 8 MHz crystal (on microgenios board set sw1 switch 10 = leds on PORTB)
/* Project: Unit 01 - IO
File: unit_01_06_DoubleChasing_LED.c
Objective: DOUBLE CHASING LEDS - The LEDs chase each other in both directions.
cIn this project 8 LEDs are connected to PORTB
of a PIC18F4520 (or PIC18F45K22) microcontroller and
the microcontroller is operated from an 8 MHz crystal.
Author: microgenios, edited by J3
/* Project: Unit 01 - IO
File: unit_01_05_Chasing_LED.c
Objective: CHASING LEDS-The program turns ON the LEDs in an an clockwise
manner with .1s delay between each output.
The net result is that LEDs seem to be chasing each other.
In this project 8 LEDs are connected to PORTB
(on microgenios board set sw1 dip = 10, LEDs on PORTB);
of a PIC18F4520 (or PIC18F45K22) microcontroller and
the microcontroller is operated from an 8 MHz crystal.
/* Project: Unit 01 - IO
Code: unit_01_04_pushAndIncrementCounter.c
Objective: While pressing RB0's button we increment a counter and
the LED's attached on RD<7:0> will lighting in a serie:);
One button control eight LEDs; Note there is a flow control; AWESOME:)
In this project 8 LEDs are connected to PORTD and 8 buttons are on PORTB
of PIC18F4520 uC, running under 8 MHZ crystal
(on microgenios board set sw1 dip = 9, LEDs on PORTD);