This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library | |
from time import sleep # Import the sleep function from the time module | |
GPIO.setwarnings(False) # Ignore warning for now | |
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering | |
GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW) # Set pin 8 to be an output pin and set initial value to low (off) | |
while True: # Run forever | |
GPIO.output(8, GPIO.HIGH) # Turn on | |
sleep(1) # Sleep for 1 second | |
GPIO.output(8, GPIO.LOW) # Turn off | |
sleep(1) # Sleep for 1 second |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Formula | |
// | |
#include <iostream> | |
#include<stdlib.h> | |
using namespace std; | |
int main() | |
{ | |
double e = 0;//energy of the problem | |
double h = 6.6256;// plank 's constant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include<conio.h> | |
using namespace std; | |
int main() | |
{ | |
int data[10]; | |
int number = 0; | |
int dElete = 0; | |
int position = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include<conio.h> | |
//void binary_hex(int n, char hex[]); | |
long long int hex_binary(char hex[]); | |
int main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int age=0; | |
int a=0; | |
int data=0; | |
int currentmoney=2000; | |
printf("Welcome to the questionnaire\n "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
int main(){ | |
int age=0; | |
int id=0; | |
int number=0; | |
int num=0; | |
int money=0; | |
printf("########################## Welcome to our lottery Game! ##########################\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* | |
SDA - D10 | |
SCk - D13 | |
MOSI - D11 | |
MISO - D12 | |
IRQ - not connected | |
GND - GND | |
RST - D9 | |
3.3-3.3 | |
To download library |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
int i, j; | |
int row = 3; | |
int col = 3; | |
int main() { | |
int a[3][3] = { {1,2,3}, {4,5,6}, {7,8,9}}; | |
for (i = 0; i < row; i++) { | |
for (j = 0; j < col; j++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ADXL335 | |
note:vcc-->5v ,but ADXL335 Vs is 3.3V | |
The circuit: | |
5V: VCC | |
analog 1: x-axis | |
analog 2: y-axis | |
analog 3: z-axis | |
*/ | |
const int xpin = 1; // x-axis of the accelerometer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int trigPin = 9; | |
const int echoPin = 10; | |
long duration; | |
int distance; | |
void setup() { | |
pinMode(trigPin, OUTPUT); | |
pinMode(echoPin, INPUT); | |
Serial.begin(9600); | |
} |