Using i386 IC using Keil uVision5 and Embedded C

Embedded C Embedded C is used in embedded systems and iot deviced such as Arduino and mico IC’s. To emulate this we can use Keil, however this can be only run on Windows, to run this on linux based distros use wine. Procedure to run The following are the steps to run a code on Keil Note: Here we are working on intel 8051AH microcontroller Install and run keil If you are on a windows system you can run the exe file locally, if you are on a linux machine you can run keil through wine and it will function just like you are running it on windows natively. \ Open a new microvision project under the projects tab. Open projects first which is located in the menu bar. Click on open a new micro vision (uVision) project. \ Locate and save the folder in the desired place (with no extension). The prompt will ask you for a cocation where the project needs to be saved. It is always a great practice to always have a new project under a new folder, this makes sure that the project files remain persistant even after making modifications or making a completely new project. \ Create a new file with the extension .c and save the file. Afte completing all the steps given above, open a new wile by using ctrl+n and saving it first with the extension .c, use ctrl+s to save the file. \ Open the startup file on the left hand side and select the add file option. Select the .c file you have created. In order to execute the code that you have written, the software must include it in the environment. To do this first on the left system tray right click and then select add existing files to group and then double select your code base file. \ Translate the file first and then build the file, both the options are available on the menubar. Translating the file changes the embedded c code to assembly level code, then build it to futher convert it into binary code. Select the debug option. In the menubar select debug, the the debug menu select start/stop debug session. This will lead you upto a debug screen. In the debug screen you have to go to the run to run the code normally, or if you have to run/debug it line by line then go to the step button to run/debug it step by step. Under the peripherals tab select the peripherals you require. Unlike other languages keil, the console does not support normal IO. You have to select a peripheral to go along with it. Gain output The output can be traced by the peripheral pins to gain any digital form of output or use analysis window to analyse the function in the analog fasion. Tasks Day 1 Briefing, difference between microprocessor and microcontroller. ...

November 16, 2023 · 4 min · 803 words · Aum Pauskar

Arduino control with peripherals

Arduino 14 IO, 6// ESP 8266 wifi Sketch - name of the program Setup - IO setup Loop - while loop DHT 11 sol moisture SR04 ultrasonic HC05 bluetooth ESP 01 wifi Q. LED blink 1 2 3 4 5 6 7 8 9 10 11 const int ledVar = 13; void setup() { pinMode(ledVar, OUTPUT); } void loop() { digitalWrite(ledVar, HIGH); delay(1000); digitalWrite(ledVar, LOW); delay(1000); } Q. Interface dht 11 with arduino uno and display humidity and temperature on serial monitor 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include <dht.h> dht DHT; #define dhtPin 4 void setup() { Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: int val = DHT.read11(dhtPin); Serial.print("Temprature: "); Serial.println(DHT.temperature); Serial.print("Humidity: "); Serial.println(DHT.humidity); delay(2000); } If else 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 // Q. Interface dht 11 with arduino uno and display humidity and temperature on serial monitor #include <dht.h> dht DHT; #define dhtPin 4 const int ledVar = 13; void setup() { Serial.begin(9600); pinMode(ledVar, OUTPUT); } void loop() { // put your main code here, to run repeatedly: int val = DHT.read11(dhtPin); Serial.print("Temprature: "); // float temp = DHT.temperature; if ( DHT.temperature > 25.00) { digitalWrite(ledVar, HIGH); } else { digitalWrite(ledVar, LOW); } Serial.println(DHT.temperature); Serial.print("Humidity: "); Serial.println(DHT.humidity); delay(2000); } Button operation 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 const char led1 = A5; const char led2 = A4; const char led3 = A3; const char led4 = A2; const int b1 = 13; const int b2 = 12; const int b3 = 11; const int b4 = 10; int buttonState1, buttonState2, buttonState3, buttonState4; void setup() { // put your setup code here, to run once: pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); pinMode(led4, OUTPUT); pinMode(b1, INPUT); pinMode(b2, INPUT); pinMode(b3, INPUT); pinMode(b4, INPUT); Serial.begin(9600); } void loop() { // put your main code here, to run repeatedl if (digitalRead(b1) == LOW) { digitalWrite(led1, HIGH); digitalWrite(led2, LOW); digitalWrite(led3, LOW); digitalWrite(led4, LOW); } else if (digitalRead(b2) == LOW){ digitalWrite(led1, LOW); digitalWrite(led2, HIGH); digitalWrite(led3, LOW); digitalWrite(led4, LOW); } else if (digitalRead(b3) == LOW){ digitalWrite(led1, LOW); digitalWrite(led2, LOW); digitalWrite(led3, HIGH); digitalWrite(led4, LOW); } else if (digitalRead(b4) == LOW){ digitalWrite(led1, LOW); digitalWrite(led2, LOW); digitalWrite(led3, LOW); digitalWrite(led4, HIGH); } else { digitalWrite(led1, LOW); digitalWrite(led2, LOW); digitalWrite(led3, LOW); digitalWrite(led4, LOW); } } LCD 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include <LiquidCrystal.h> const int rs = 6, en = 7, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { lcd.begin(16,2); lcd.print(" Hello "); lcd.setCursor(0,1); lcd.print(" World "); } void loop() { // put your main code here, to run repeatedly: lcd.noDisplay(); lcd.display(); delay(5000); } IoT internship project 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 /*Problem statement Interface LCD with Arduino Uno to display the right to left scrolling message IoT Internship */ // title, problem statement, onjective, components, interfacing block diagram // libraries #include <LiquidCrystal.h> // programming constants const int rs = 6, en = 7, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); int initialDelay = 1000; int pixelDelay = 300; char message[] = "IoT Internship"; void setup() { lcd.begin(16, 2); lcd.print(message); delay(initialDelay); } void loop() { // given count values to properly scroll through the screen for (int positionCounter = 0; positionCounter < 13; positionCounter++) { lcd.scrollDisplayLeft(); delay(pixelDelay); } for (int positionCounter = 0; positionCounter < 29; positionCounter++) { lcd.scrollDisplayRight(); delay(pixelDelay); } for (int positionCounter = 0; positionCounter < 16; positionCounter++) { lcd.scrollDisplayLeft(); delay(pixelDelay); } delay(1000); }

November 16, 2023 · 4 min · 707 words · Aum Pauskar

OOPS with Java

Java tutorial Java is a cross platform compiled language that uses jvm (java virtual machine) that can be used in any machine no matter the hardware or software, provided the machine supports jvm FYI The object class is the root of all classes Data can be gatered with the scanner method in the java library but cannot cater charecter type data with the standard library. Those can be gathered by sc = next().charat(0) Hello world Code ...

November 16, 2023 · 22 min · 4594 words · Aum Pauskar

Virtualenv

Python virtual environment Python virtual environemt is a program that aids in creating a serperate virtual environment for each project Requiremnets Python 3 Pip Steps Installing virtual environemnt package 1 pip install virtualenv Creating virtual environent Windows - cmd/powershell 1 py -m venv {your_env_name} Linux 1 python3 -m venv myworld Activating virtual environemt Windows - cmd 1 myworld\Scripts\activate.bat Windows - powershell 1 myworld\Scripts\activate.ps1 Linux ...

November 16, 2023 · 1 min · 76 words · Aum Pauskar

My First Post

Hello World This is my first post 1 print("Hello World")

November 16, 2023 · 1 min · 10 words · Aum Pauskar