Skip to content

Instantly share code, notes, and snippets.

@gresan-gits
gresan-gits / main.c
Created February 2, 2020 11:02
CCS C ADC
#include <main.h>
#use rs232(UART1,baud=9600,parity=N,stream=UART,errors)
INT16 value, value2;
float vol;
void test(){
float a=5;
float b=1024;
float v=(float)a/b;
@gresan-gits
gresan-gits / code.c
Created February 2, 2020 10:48
CCS RS232
#include <18F4520.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
#FUSES HS //High speed Osc (> 4mhz FOR PCM/PCH) (>10mhz for PCD)
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used FOR I/O
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#use delay(clock=12000000)
#use rs232(FORCE_SW,baud=4800,parity=N,xmit=PIN_B3,rcv=PIN_B4,bits=8,stream=UART_MEM,errors)
@gresan-gits
gresan-gits / main.c
Created February 2, 2020 10:33
CCS C IO
#include <main.h>
#include <output.c>
int8 in;
void main ()
{
output_float (pin_D7) ;
//Example blinking LED program
while (true)
{
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#include <Ultrasonic.h>
#define LED D0 // Led in NodeMCU at pin GPIO16 (D0).
// Set these to run example.
#define FIREBASE_HOST "garagecardetector.firebaseio.com"
#define FIREBASE_AUTH "TuJmJEc1YJRAOtEEiS1qYxYE2KiqRDaWNkGxyLhm"//change with your Database secrets