














































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Computer system internership projects
Typology: Schemes and Mind Maps
1 / 54
This page cannot be seen from the preview
Don't miss anything!















































{} Internship projects basically with arduino uno and esp8266 and other components $$
int redPin = 9; int greenPin = 10; int bluePin = 11; void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { // Example: Show RED digitalWrite(redPin, HIGH); digitalWrite(greenPin, LOW);
digitalWrite(bluePin, LOW); delay(1000); // Example: Show GREEN digitalWrite(redPin, LOW); digitalWrite(greenPin, HIGH); digitalWrite(bluePin, LOW); delay(1000); // Example: Show BLUE digitalWrite(redPin, LOW); digitalWrite(greenPin, LOW); digitalWrite(bluePin, HIGH); delay(1000); // Example: Show WHITE (all on) digitalWrite(redPin, HIGH); digitalWrite(greenPin, HIGH); digitalWrite(bluePin, HIGH); delay(1000);
// constants won't change: const long interval = 1000; // interval at which to blink (milliseconds) void setup() { // set the digital pin as output: pinMode(ledPin, OUTPUT); } void loop() { // here is where you'd put code that needs to be running all the time. // check to see if it's time to blink the LED; that is, if the difference // between the current time and last time you blinked the LED is bigger than // the interval at which you want to blink the LED. unsigned long currentMillis = millis(); if (currentMillis - previousMillis >= interval) {
// save the last time you blinked the LED previousMillis = currentMillis; // if the LED is off turn it on and vice-versa: if (ledState == LOW) { ledState = HIGH; } else { ledState = LOW; } // set the LED with the ledState of the variable: digitalWrite(ledPin, ledState); } }
const int buttonPin = 2; // the number of the pushbutton pin const int ledPin = 13; // the number of the LED pin
} else { // turn LED off: digitalWrite(ledPin, LOW); } } 4. A C++ program to perfor a digital pull up void setup() { //start serial connection Serial.begin(9600); //configure pin 2 as an input and enable the internal pull-up resistor pinMode(2, INPUT_PULLUP); pinMode(13, OUTPUT); } void loop() { //read the pushbutton value into a variable int sensorVal = digitalRead(2);
//print out the value of the pushbutton Serial.println(sensorVal); // Keep in mind the pull-up means the pushbutton's logic is inverted. It goes // HIGH when it's open, and LOW when it's pressed. Turn on pin 13 when the // button's pressed, and off when it's not: if (sensorVal == HIGH) { digitalWrite(13, LOW); } else { digitalWrite(13, HIGH); } }
#include <HCSR04.h> byte triggerPin = 21; byte echoPin = 12;
// Define pins for both sensors byte triggerPins[] = {21, 7}; byte echoPins[] = {12, 8}; void setup() { Serial.begin(9600); // Initialize both sensors HCSR04.begin(triggerPins, echoPins, 2); // 2 = number of sensors } void loop() { // Measure distances double* distances = HCSR04.measureDistanceCm(); // Print distances Serial.print("Sensor 1: "); Serial.print(distances[0]);
Serial.println(" cm"); Serial.print("Sensor 2: "); Serial.print(distances[1]); Serial.println(" cm"); Serial.println("---"); delay(500); }
#include <Ultrasonic.h> /*
Serial.begin(9600); } void loop() { Serial.print("Sensor 01: "); Serial.print(ultrasonic1.read()); // Prints the distance on the default unit (centimeters) Serial.println("cm"); Serial.print("Sensor 02: "); Serial.print(ultrasonic2.read(CM)); // Prints the distance making the unit explicit Serial.println("cm"); Serial.print("Sensor 03: "); Serial.print(ultrasonic3.read(INC)); // Prints the distance in inches Serial.println("inc"); delay(1000); }
int irPin = 2;
void setup() { pinMode(irPin, INPUT); Serial.begin(9600); } void loop() { int val = digitalRead(irPin); if (val == LOW) { Serial.println("Object detected"); } else { Serial.println("No object"); } delay(500); }
int ldrPin = A0;
void loop() { myServo.write(0); // Move to 0 ° delay(1000); myServo.write(90); // Move to 90 ° delay(1000); myServo.write(180); // Move to 180 ° delay(1000); }
int waterPin = A1; void setup() { Serial.begin(9600); } void loop() { int waterLevel = analogRead(waterPin);
Serial.print("Water Level: "); Serial.println(waterLevel); delay(500); }
int smokePin = A0; void setup() { Serial.begin(9600); } void loop() { int smokeValue = analogRead(smokePin); Serial.print("Smoke Level: "); Serial.println(smokeValue); delay(500); }
int pirPin = 3; void setup() { pinMode(pirPin, INPUT); Serial.begin(9600);
sensors.begin(); } void loop() { sensors.requestTemperatures(); float temp = sensors.getTempCByIndex(0); Serial.print("Temp: "); Serial.print(temp); Serial.println(" °C"); delay(1000); }
cpp Copy Edit int hallPin = 2; void setup() { pinMode(hallPin, INPUT); Serial.begin(9600); } void loop() {
if (digitalRead(hallPin) == LOW) { Serial.println("Magnet Detected"); } else { Serial.println("No Magnet"); } delay(500); }
int vibPin = 3; void setup() { pinMode(vibPin, INPUT); Serial.begin(9600); } void loop() { int state = digitalRead(vibPin); if (state == HIGH) { Serial.println("Vibration Detected"); } delay(200);