Skip to content

Instantly share code, notes, and snippets.

View raghavendrahassy's full-sized avatar
🎯
Focusing

Gururaghavendra Hasigal raghavendrahassy

🎯
Focusing
View GitHub Profile
#include <SPI.h>
#include <SD.h>
#include <SparkFunDS1307RTC.h>
#include <Wire.h>
#include "max6675.h"
int ktcSO = 8;
int ktcCS = 9;
int ktcCLK = 10;
const int chipSelect = 4;
/*
*
* Blynk app controlled Robot with Horbill ESP32.
* For more details visit:
* https://exploreembedded.com/wiki/Robo_with_Hornbill_ESP32
*
*
*/
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include "lcd.h"
/*
*
*/
int main()
{
/*Connect RS->P0.0, RW->P0.1, EN->P0.2 and data bus to P0.4 to P0.7*/
LCD_SetUp(P0_0,P0_1,P0_2,P_NC,P_NC,P_NC,P_NC,P0_4,P0_5,P0_6,P0_7);
LCD_Init(1,16);
#include "lcd.h"
/*
*
*/
int main()
{
/*Connect RS->P0.0, RW->P0.1, EN->P0.2 and data bus to P0.4 to P0.7*/
LCD_SetUp(P0_0,P0_1,P0_2,P_NC,P_NC,P_NC,P_NC,P0_4,P0_5,P0_6,P0_7);
LCD_Init(4,20);
#include "lcd.h"
/*
*
*/
int main()
{
/*Connect RS->P0.0, RW->P0.1, EN->P0.2 and data bus to P0.4 to P0.7*/
LCD_SetUp(P0_0,P0_1,P0_2,P_NC,P_NC,P_NC,P_NC,P0_4,P0_5,P0_6,P0_7);
@raghavendrahassy
raghavendrahassy / Switch and Led with 8051.c
Created June 17, 2016 11:45
Explore Starter 8051 board has 2 user interface switches on the board which are connected to P3.2 and P3.3 . There are 4 LED's are on board which are also connected to higher four bits of P3. Out of these we will read the status of SW2 ( Connected to P3.3) and will show the status on LED ( Connected to P3.7).
#include <reg51.h>
sbit LED = P3^7; // LED is connected to P3.7
sbit Switch = P3^3; // Switch is connected to P3.3
int main()
{
P3 = 0x08; // Switch declared as input and LED as output
@raghavendrahassy
raghavendrahassy / 01a-LedBlinking_Example.c
Created June 15, 2016 12:22
LED Blinking with 8051 Starter Board
#include <reg51.h>
#define LED P3 // LED's are connected to higher bits of P3
void DELAY_ms(unsigned int ms_Count)
{
unsigned int i,j;
for(i=0;i<ms_Count;i++)
{
#include <avr/io.h>
#define FOSC 16000000// Clock Speed
#define BAUD 9600
#define MYUBRR FOSC/16/BAUD-1
void USART_Init( unsigned int ubrr );
void USART_Transmit( unsigned char data );
unsigned char USART_Receive( void );
unsigned char USART_Receive( void )
{
/* Wait for data to be received */
while ( !(UCSR0A & (1<<RXC)) )
;
/* Get and return received data from buffer */
return UDR0;
}
void USART_Transmit( unsigned char data )
{
/* Wait for empty transmit buffer */
while ( !( UCSR0A & (1<<UDRE)) )
;
/* Put data into buffer, sends the data */
UDR0 = data;
}