Program: #include <GL/gl.h> #include <GL/glut.h> #include <math.h> //global variable diclaration int frameNumber = 0; //fr...
Read More
13 Program to draw Koch Curve/Koch snowflake in OpenGL
Program: #include <iostream> #include <GL/glut.h> #include <GL/freeglut.h> #include <math.h> using namespace std; #...
Read More
12 Program to implement Sutherland Hodgman Polygon Clipping in OpenGL
Program: // Sutherland Hodgman Polygon Clipping Complete Code | implementation through openGL #include <stdio.h> #include <GL/gl.h...
Read More
11 OpenGL Program to Perform 2D Transformation: 1) Reflection and 2)Shearing on a Polygon
Program: #include<GL/glut.h> #include<math.h> double parr[8]; void init() { glClear(GL_COLOR_BUFFER_BIT); glClearColor(0,0,...
Read More
10 Program to draw hill using Bresenham Line Drawing Algorithm and fill color using Seed fill Algorithm in OpenGL
Program: #include<GL/glut.h> void init() { glClear(GL_COLOR_BUFFER_BIT); glClearColor(1,1,1,0); gluOrtho2D(0,500,0,500); } int l...
Read More
9 OpenGL Program for 2D Transformation 1) Translation 2) Scaling 3) Rotation on a Polygon
Program: #include<GL/glut.h> #include<math.h> double parr[8]; void init() { glClear(GL_COLOR_BUFFER_BIT); glClearColor(0,0,...
Read More
8 Program for clipping a Line using Cohen Sutherland Algorithm in OpenGL
Program: #include<GL/glut.h> // TBRL int left = 1,right = 2, top = 8, bottom = 4; int xmin = 100, xmax = 400, ymin = 100, ymax = 40...
Read More
Embedded C program for LCD interfacing with PIC18F in MPLAB IDE
Note: PORT's connection will be different based on the kit you are using by the manufacturer for PIC18F. Program: #include <pic18f...
Read More
Embedded C program for Generating PWM signal for servo motor/DC motor in PIC18F using MPLAB IDE
Program: /* Calculations * Fosc = 48MHz * * PWM Period = [(PR2) + 1] * 4 * TMR2 Prescale Value / Fosc * PWM Period = 200us * TMR2...
Read More
Embedded C program for PC to PC serial communication using UART in PIC18F using MPLAB IDE
For UART PC to PC Serial Communication: Go on Project -> Right Click -> Properties-> Simulation-> Option Categories->Uart1 IO...
Read More
Embedded C program for External interrupt input switch press, output at relay using PIC18F in MPLAB IDE
Program: #include <pic18f4550.h> //#include<xc.h> #define RELAY_PIN LATAbits.LATA4 void __interrupt() extint_isr(void) { ...
Read More
Embedded C program for Timer programming ISR based buzzer on/off using PIC18F in MPLAB IDE
Program: #include <xc.h> int c=0; void __interrupt() tmr1_isr(){ c++; if(c==1000){ c=0; LATAbits.LATA5=~LATAb...
Read More
Embedded C program to Interface PIC18F with LED & blinking it using specified delay using PIC18F in MPLAB IDE
Program: #include <xc.h> void main(void) { TRISB=0; PORTB=128; while(1) { PORTB = 0xFF; ...
Read More
How to Run PIC18F Program on PIC18F4550 Microcontroller Kit ?
We are using PIC18F4550 and MPLAB IDE to Run this Program. For Running PIC ( Peripheral Interface Controller) Program on PIC18F4550 kit. ...
Read More
Embedded C program for sorting the numbers in ascending or descending orders. Consider any 2-sorting algorithms for menu driven program in PIC18 using MPLAB IDE
Program: #include <xc.h> void main(void) { int i, j, key, temp, flag = 0, choice; int arr[] = { 4, 1, 3, 5, ...
Read More
Program to Divide two 8bit Numbers using PIC18F MCU in MPLAB IDE using Embedded C
Program: #include <xc.h> void main(void) { PORTA = 0x50; // 80 PORTB = 0x02; // 02 TRISA = 0; TRISB = 0; ...
Read More
Program to Multiply two 8bit numbers using PIC18F MCU in MPLAB IDE using Embedded C
Program: #include <xc.h> void main(void) { TMR0H = 0x1B; // 1B = 27 TMR0L = 0x0A; // 0A = 10 int a = TMR0H *...
Read More
Subscribe to:
Posts (Atom)