Sunday, January 6, 2019

12 LED's Running Lights in Arduino

In this article I would like to share with you a sample applications that I wrote using C in Arduino to perform 12 LED's Running Lights. The source code is very simple and easy to understand.

I am currently accepting programming work, it projects, school and application development.

programming projects, thesis and capstone projects, IT consulting.

work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com








Sample Program Output


Program Listing

/* A simple program to sequentially turn on and turn off 12 LED's
   Author : Jake R. Pomperada, MAED-IT
   January 6, 2019  Sunday
   Bacolod City, Negros Occidental, Philippines
   jakerpomperada@gmail.com and jakerpomperada@yahoo.com
*/ 

int LED1 = 13;
int LED2 = 12;
int LED3 = 11;
int LED4 = 10;
int LED5 = 9;
int LED6 = 8;
int LED7 = 7;
int LED8 = 6;
int LED9 = 5;
int LED10 = 4;
int LED11 = 3;
int LED12 = 2;



void setup() {
   pinMode(LED1, OUTPUT);
   pinMode(LED2, OUTPUT);
   pinMode(LED3, OUTPUT);
   pinMode(LED4, OUTPUT);
   pinMode(LED5, OUTPUT);
   pinMode(LED6, OUTPUT);
   pinMode(LED7, OUTPUT);
   pinMode(LED8, OUTPUT);
   pinMode(LED9, OUTPUT);
   pinMode(LED10, OUTPUT);
   pinMode(LED11, OUTPUT);
   pinMode(LED12, OUTPUT);
}


void loop() {
  digitalWrite(LED1, HIGH);    // turn on LED1 
  delay(200);                  // wait for 400ms
  digitalWrite(LED2, HIGH);    // turn on LED2
  delay(200);                  // wait for 400ms       
  digitalWrite(LED3, HIGH);    // turn on LED3 
  delay(200);                  // wait for 400ms
  digitalWrite(LED4, HIGH);    // turn on LED4
  delay(200);                  // wait for 400ms
  digitalWrite(LED5, HIGH);    // turn on LED5
  delay(200);                  // wait for 400ms
  digitalWrite(LED6, HIGH);    // turn on LED6
  delay(200);                  // wait for 400ms
  digitalWrite(LED7, HIGH);    // turn on LED7
  delay(200);                  // wait for 400ms
  digitalWrite(LED8, HIGH);    // turn on LED8
  delay(200);                  // wait for 400ms
  digitalWrite(LED9, HIGH);    // turn on LED9
  delay(200);                  // wait for 400ms
  digitalWrite(LED10, HIGH);    // turn on LED10
  delay(200);                  // wait for 400ms
  digitalWrite(LED11, HIGH);    // turn on LED11
  delay(200);                  // wait for 400ms
  digitalWrite(LED12, HIGH);    // turn on LED12
  delay(200);                  // wait for 400ms
  digitalWrite(LED1, LOW);     // turn off LED1
  delay(200);                  // wait for 400ms
  digitalWrite(LED2, LOW);     // turn off LED2
  delay(200);                  // wait for 300ms
  digitalWrite(LED3, LOW);     // turn off LED3
  delay(200);                  // wait for 400ms
  digitalWrite(LED4, LOW);     // turn off LED4
  delay(200);                  // wait for 300ms
  digitalWrite(LED5, LOW);     // turn off LED5
  delay(200);                  // wait for 400ms
  digitalWrite(LED6, LOW);     // turn off LED6
  delay(200);                  // wait for 400ms
  digitalWrite(LED7, LOW);     // turn off LED7
  delay(200);                  // wait for 400ms
  digitalWrite(LED8, LOW);     // turn off LED8
  delay(200);                  // wait for 300ms
  digitalWrite(LED9, LOW);     // turn off LED9
  delay(200);                  // wait for 400ms
  digitalWrite(LED10, LOW);     // turn off LED10
  delay(200);                  // wait for 400ms
  digitalWrite(LED11, LOW);     // turn off LED11
  delay(200);                  // wait for 400ms
  digitalWrite(LED12, LOW);     // turn off LED8
  delay(200);                  // wait for 300ms before running program all over again
}


Addition and Difference in Delphi

Here is a simple program to perform addition and subtraction in Delphi. I used Delphi 7 Enterprise edition in writing this program. 

I am currently accepting programming work, it projects, school and application development.

programming projects, thesis and capstone projects, IT consulting.

work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com




Program Listing

unit add_differece;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
   
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
var a,b : integer;

procedure TForm1.Button1Click(Sender: TObject);
begin
a:= strtoint(edit1.text);
b:= strtoint(edit2.text);
label6.caption := 'The sum of ' + inttostr(a) + ' and ' +inttostr(b) + ' is ' +inttostr(a+b) + '.';
label7.caption := 'The difference of ' + inttostr(a) + ' and ' +inttostr(b) + ' is ' +inttostr(a-b) + '.';
end;


procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.text := '';
edit2.text := '';
label6.caption :='';
label7.caption :='';
edit1.SetFocus;

end;


procedure TForm1.Button3Click(Sender: TObject);
begin
    if MessageDlg('Do you want to quit this program?', mtConfirmation, [mbYes, mbNO], 0) = mrYes then
begin
form1.Close;
end
else
begin
edit1.SetFocus;
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin

end;

end.

Saturday, January 5, 2019

Swap Two Numbers Using Pointers in C

I am currently accepting programming work, it projects, school and application development.

programming projects, thesis and capstone projects, IT consulting.

work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

Problem 

Write a program that will ask the user to give two numbers and then 
the program will swap the arrangement of the two numbers and display
the result on the screen.

Solution

/* swap.c
   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
   Date     : November 26, 2018  Monday  3:09 PM
   Location : Bacolod City, Negros Occidental
   Tool     : Dev C++ Version 5.11
   Website  : http://www.jakerpomperada.com
   Email    : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com
*/
#include <stdio.h>

void swap(int *num1, int *num2);

int main()
{
    int num1=0, num2=0;
    printf("\n\n");
    printf("\tSwap Two Numbers");
    printf("\n\n");
    printf("\tEnter Two Numbers : ");
    scanf("%d%d", &num1, &num2);
    printf("\n\n");
    printf("\tBefore swapping in main");
    printf("\n\n");
    printf("\tValue of num1 = %d \n", num1);
    printf("\tValue of num2 = %d \n\n", num2);
    swap(&num1, &num2);
    printf("\n");
    printf("\tEnd of Program");
    printf("\n\n");
  
}

void swap(int * num1, int * num2)
{
    int temp;
    temp = *num1;
    *num1= *num2;
    *num2= temp;

    printf("\tAfter swapping in swap function ");
    printf("\n\n");
    printf("\tValue of num1 = %d. \n", *num1);
    printf("\tValue of num2 = %d. \n\n", *num2);

}

Largest of Three Numbers Using Pointers in C

I am currently accepting programming work, it projects, school and application development.

programming projects, thesis and capstone projects, IT consulting.

work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

Problem 

Write a program that will ask the user to give three numbers
and then the program will check which of the three numbers 
has the highest in terms of numerical value and display the
result on the screen.


Solution

#include<stdio.h>
int main()
{
  int x=0, y=0, z=0;
  int *a, *b, *c;
  
  printf("\n\n");
  printf("\tLargest of Three Numbers");
  printf("\n\n");
  printf("\tEnter Three Numbers : ");
  scanf("%d%d%d",&x, &y, &z);
  a = &x;
  b = &y;
  c = &z;
  if(*a > *b)
  {
    if(*a > *c)
    {
      printf("\n\n");
  printf("\t%d is larger than %d and %d.", *a, *b, *c);
    }
    else
    {
      printf("\n\n");
  printf("\t%d is larger than %d and %d.", *c, *a, *b);
    }
  } 
  else
  {
     if(*b > *c)
     {
        printf("\n\n");
printf("\t%d is larger than %d and %d.", *b, *a, *c);
     }
     else
     {
        printf("\n\n");
printf("\t%d is larger than %d and %d", *c, *a, *b);
     }
  }
printf("\n\n");
printf("\tEnd of Program");
printf("\n\n");


Area of the Circle Using Pointers in C

In this article, I would like to share with you a sample program that will ask the radius of the circle and compute its area and perimeters using pointers in C.

I am currently accepting programming work, it projects, school and application development.


programming projects, thesis and capstone projects, IT consulting.

work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Problem 

Write a program that will ask the user the radius of the circle
and then the program will compute it's area and perimeter of the circle
and display the result on the screen.

Program Listing

/* area_circle.c
   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
   Date     : November 26, 2018  Monday  2:19 PM
   Location : Bacolod City, Negros Occidental
   Tool     : Dev C++ Version 5.11
   Website  : http://www.jakerpomperada.com
   Email    : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com
*/

#include<stdio.h>

void solve_area( int r, float *a, float *p )
{
*a = 3.14 * r * r ;
*p = 2 * 3.14 * r ;
}

int main( )
{
int radius=0;
float area=0.00, perimeter=0.00 ;

printf("\n\n");
printf("\tArea of the Circle");
printf("\n\n");
printf ("\tEnter Radius of a Circle : " ) ;
scanf ( "%d", &radius ) ;

solve_area(radius, &area, &perimeter ) ;

printf("\n\n");
printf("\t===== DISPLAY REPORT =====");
printf("\n\n");
printf ( "\tThe Area = %.2f.", area ) ;
printf ( "\tThe Perimeter = %.2f.", perimeter ) ;
printf("\n\n");
printf("\tEnd of Program");
printf("\n\n");

}

Odd and Even Number Checker in Go

In this article, I share with you guys a simple if - else statement example how to check if the given number is an odd or even number from the user using Go as our programming language.

I am currently accepting programming work, it projects, school and application development.

programming projects, thesis and capstone projects, IT consulting.

work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output

Program Listing

// odd_even.go

package main

import "fmt"

func main(){
    var num_value int32
    fmt.Print("\n")
    fmt.Print("\tOdd and Even Number Checker")
    fmt.Print("\n\n")
    fmt.Print("\tKindly give a number? ")
    fmt.Scanln(&num_value)
  if num_value % 2 ==0 {
       fmt.Print("\n")
       fmt.Print("\tThe given number ")
       fmt.Printf("%d",num_value)
       fmt.Print(" is an Even Number.")
    } else {
       fmt.Print("\n")
       fmt.Print("\tThe given number ")
       fmt.Printf("%d",num_value)
       fmt.Print(" is an Odd Number.")
    }
    fmt.Print("\n\n")
    fmt.Print("\tEnd of Program")
    fmt.Print("\n")
}




Leap Year Checker in Go

Happy New Year 2019 it has been a while since I wrote a code in my blog in this article I would like to share with you another sample program that I wrote using Go programming language to check if the given year is a leap year or not a leap year.

I am currently accepting programming work, it projects, school and application development.

programming projects, thesis and capstone projects, IT consulting.

work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output

Program Listing


// leap_year.go

package main

import "fmt"

func main(){
    var year int32
    fmt.Print("\n")
    fmt.Print("\tLeap Year Checker")
    fmt.Print("\n\n")
    fmt.Print("\tGive a Year : ")
    fmt.Scanln(&year)
    if(((year % 4 == 0) && (year % 100 !=0)) || (year % 400==0)) {
       fmt.Print("\n")
       fmt.Print("\tThe given year ")
       fmt.Printf("%d",year)
       fmt.Print(" is a LEAP year.")
    } else {
       fmt.Print("\n")
       fmt.Print("\tThe given year ")
       fmt.Printf("%d",year)
       fmt.Print(" is NOT a LEAP year.")
    }
    fmt.Print("\n\n")
    fmt.Print("\tEnd of Program")
    fmt.Print("\n")
}







Monday, December 31, 2018

Alternating LED Flasher in Arduino

Before the coming of new year 2019 I have decided to write a code to perform alternating LED Flasher using Arduino UNO it is fun because I was able to apply my knowledge in C programming rstand the concepts and principle of Arduino. I hope you will find my work useful. May the new year 2019 brings us new learning experience.

I am currently accepting programming work, it projects, school and application development.

programming projects, thesis and capstone projects, IT consulting 

work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

My personal website is http://www.jakerpomperada.com






Sample Program Output


Program Listing

/* Alternating LED Flasher in Arduino UNO
 *  Author : Mr. Jake R. Pomperada, MAED-IT
 *  Date : December 31, 2018 
 *  Bacolod City, Negros Occidental
 */


#define YELLOW 8
#define RED 7

void setup()
{
pinMode(YELLOW,OUTPUT);
pinMode(RED,OUTPUT);
}

void loop()
{
 digitalWrite(YELLOW,HIGH);
 digitalWrite(RED,LOW);
 delay(500);
 digitalWrite(YELLOW,LOW);
 digitalWrite(RED,HIGH);
 delay(500);
}



Saturday, December 29, 2018

LED Blinking in Arduino Uno

In this article I would like to share with you a very simple program that I wrote to make the LED or Light Emitting Diode blink using Arduino. I am just learning how to write a program using Arduino and I feel it is a very fun way to spend spare time. 

I am currently accepting programming work, it projects, school 

programming projects, thesis and capstone projects, IT consulting 

work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

My personal website is http://www.jakerpomperada.com






Sample  Program Output


Program Listing

/* LED Blinking
 *  Author : Mr. Jake Rodriguez Pomperada,MAED-IT
 *  Date   : December 29, 2018  Saturday
 *  Bacolod City, Negros Occidental
 *  jakerpomperada@yahoo.com
 */

#define LED 13

void setup() {
  pinMode(LED, OUTPUT); 
}

void loop() {
  digitalWrite(LED, HIGH);
  delay(2000);
  digitalWrite(LED,LOW);
  delay(500);
}