Skip to content

Instantly share code, notes, and snippets.

View ARod's full-sized avatar

ARod ARod

  • AJ Technologies LLC
  • Madison
View GitHub Profile
@ARod
ARod / vl53l0x.c
Created March 16, 2017 22:50
VL530X Sensor TimingOut after 15 to 20 minutes Output 65536
#include <Wire.h>
#include <VL53L0X.h>
#define RSensorPin 52
#define LSensorPin 50
VL53L0X RSensor; // Right Sensor
VL53L0X LSensor; // Left Sensor
// GPIO
int *PORTA = 0xF80;
int *PORTB = 0xF81;
int *PORTC = 0xF82;
int *PORTD = 0xF83;
int *LATA = 0xF89;
int *LATB = 0xF8A;
int *LATC = 0xF8B;
int *LATD = 0xF8C;
#include <18f4520.h>
#use delay (clock = 20000000)
#fuses HS, NOWDT, NOLVP
#include "..\Library\18f4520Reg.h"
#include "..\Library\modifiedlcd.h"
#INT_RDA
void int_rda_isr(){
if(*RCREG>0){
*CCPR2 = *RCREG;
#include <18f4520.h>
#use delay (clock = 20000000)
#fuses HS, NOWDT, NOLVP
#include "..\Library\18f4520Reg.h"
#include "..\Library\modifiedlcd.h"
#include "..\Library\keyPad.h"
#INT_RDA
void int_rda_isr(){
printf(lcd_putc,"\f %luHz",(long)((*RCREG)+1000));
#include <stdio.h>
#include <conio.h>
#define SET 1
#define RESET 2
#define TOGGLE 3
#define READ 4
#define QUIT 0
void binaryPrint(int x);
int setBit(int number, int loc);
@ARod
ARod / mv.c
Created September 3, 2014 01:55
Messing with Variables
#include <stdio.h>
#include <conio.h>
main(){
int x = -345;
float y = 3.123456789;
char z = 'A';
printf("x is %d \n y %.6f \n z is %c", x ,y, z);
while(!kbhit());
@ARod
ARod / Hello.c
Created September 2, 2014 19:40
This is a test
#include <stdio.h>
#include <conio.h>
main(){
printf(" Hello World ");
while(1);
}
@ARod
ARod / gist:9396789
Created March 6, 2014 18:51
Fibonacci
#include <stdio.h>
#include <conio.h>
void fibonacci(int *array, int limit);
main(){
int x=0, myArray[100], seed1, seed2, limit;
printf(" Please enter two seeds and limit: ");
scanf(" %d %d %d", &myArray[0], &myArray[1], &limit);
fibonacci(myArray, limit);
@ARod
ARod / gist:8949624
Created February 12, 2014 03:30
Digits
#include <stdio.h>
#include <conio.h>
main(){
int input, x=1;
printf("Enter and integer: ");
scanf(" %d", &input);
while( input > 1){
input = input / 10;
x++;
}
@ARod
ARod / gist:8948615
Created February 12, 2014 02:02
Simple C Accumulator
#include <stdio.h>
#include <conio.h>
main(){
int x, sum=0;
for(x=0;x<10;x++){
printf("\n %d Please enter a number: ", x);
scanf(" %d", &x);
sum = sum + x;
}
printf("The overall sum is %d", sum);