Skip to content

Instantly share code, notes, and snippets.

Onyango Okelo theokelo

View GitHub Profile
@theokelo
theokelo / led4_7_595MSB.ino
Created Apr 21, 2018
Arduino Code for a Controlling a Common Cathode 4 Digit 7 Segment Display using Two Shift Registers
View led4_7_595MSB.ino
int latchPin = 2; //pin 12 on the 595
int dataPin = 3; //pin 14 on the 595
int clockPin = 4; //pin 11 on the 595
//D1 = 256, D2 = 512, D3 = 1024, D4 = 2048
int D1 = 3584;
int D2 = 3328;
int D3 = 2816;
int D4 = 1792;
View four_seven_led.ino
// assigning arduino digital pins for the various led display pins
int pinA = 3;
int pinB = 7;
int pinC = 12;
int pinD = 10;
int pinE = 9;
int pinF = 4;
int pinG = 13;
int pinDP = 11; // the decimal point pin
int D1 = 2;
@theokelo
theokelo / pushAndFade.ino
Created Aug 3, 2015
Arduino Code for an LED button control
View pushAndFade.ino
int LED = 9; //pin for the LED
int BUTTON = 7; //pin for the BUTTON
int val = 0; //stores state of the pin
int old_val = 0; //stores previous state of the pin
int state = 0;
int brightness = 128; //stores brightness value
int old_b = 127;
unsigned long startTime = 0; //when did we begin pressing?
void setup()
@theokelo
theokelo / helloWorld.c
Created Jun 8, 2015
Introductory C Program
View helloWorld.c
#include <stdio.h>
int main (void)
{
printf("Hello world!");
return 0;
}
@theokelo
theokelo / blinkingLED.ino
Last active Jan 10, 2018
Arduino Blinking LED Code
View blinkingLED.ino
// Example 01 : Blinking LED
const int LED = 13; // LED connected to digital pin 13
void setup ()
{
pinMode(LED, OUTPUT); //sets the digital pin as output
You can’t perform that action at this time.