Skip to main content

social

pop

Arduino Commands Syntax

 ARDUINO COMMANDS

Basic Arduino IDE Commands

1. pinMode(x, OUTPUT);

Configure or assign the pin number x as an output pin. Where x is the digital pin number on the arduino device which you intend to use as an output.

2. pinMode(x, INPUT); 

Configure or assign the pin number x as an input pin. Where x is the digital pin number on the arduino device which you intend to use as an input.

3. digitalWrite(x, HIGH);

Turn the digital pin number x ON or as HIGH. Where x is the digital pin number on the arduino device which you intend to turn ON. Note that turning it HIGH gives out a voltage of 5V at that digital pin. So this can be used to turn on or drive some devices connected at the pin e.g LED, activating relays for driving circuit, etc.

4. digitalWrite(x, LOW);

Turn the digital pin number x OFF or as LOW. Where x is the digital pin number on the arduino device which you intend to turn OFF. Note that turning it LOW gives out a voltage of 0V at that digital pin. So this can be used to turn OFF or drive some devices connected at the pin at low logic e.g LED, activating relays for driving circuit etc.

5. digitalRead(x);

Read the digital pin. Where x is the digital pin number 

6. analogRead(analog pin); 

Read the analog pin. Analog pin as A0 or A1 or A2, or A3 etc.

7. analogReference();

Configures or sets a reference voltage used for analog input 


LCD Commands for Arduino

1. lcd.begin(16, 2); 

Initialize the 16 x 2

lcd.begin(20, 4);

Initialize the 20 x 4 LCD

2. lcd.setCursor(x, y);

Set the cursor of LCD at a desired column and row. Where x is the column number and y is the row number on the LCD.

3. lcd.print(“EKETECH”); 

Print a string “EKETECH” on the LCD

4. lcd.print(EKETECH);

printing the integer attributed in EKETECH on the LCD. So whatever integer is attributed or “stored” in EKETECH will be printed on the LCD. So in your code, EKETECH must be declared as a variable e.g as an integer, otherwise you will obtain a compilation error while running the code.

5. lcd.Clear();

Clear all the contents displayed on the LCD

Serial Communication Commands for Arduino

1. Serial.begin(baudrate);

Initialize serial communication. Set baud rate to 600 or 1200 or 2400 or 4800 or 9600 bits per second

2. Serial.print(“EKETECH”);

Serial print fixed string with a defined baud rate on the Tx line. Note Tx pin signifies transmission pin.  

3. Serial.println(“EKETECH”);

Serial print fixed string EKETECH with a defined baud rate and enter command on the Tx line. Note that the ln included infront of print, gives an enter command or new line to any new or subsequents data transmitted. 

4. Serial.print(EKETECH);

Serial print the integer string with a defined baud rate on the Tx line. So tyhis will print the interger attributed to EKETECH and not printing the string “EKETECH”

5. Serial.println(EKETECH);

Serial print the integer string with a defined baud rate and then the enter command on the Tx line, which enables printing on a new line

6. Serial.Write(BYTE);

Serial transfer the 1 byte on the Tx line

7. Serial.read();

Read 1 byte serial from the Rx line

Interrupts

1. interrupts( )

Enable interrupts. Interrupts will cause the processor to urgently stop any other task and an immediately process another task while pending the one it was executing. So, interrupts can disrupt the timing of a code.

2.  noInterrupts( )

Disable interrupts.  Also, Some functions will not work with disabled interrupts. For example, incoming data communication can be ignored. 

Data Types

char, array, float, bool, boolean, short, byte, long, int, double,
unsigned char, String(), string, void, unsigned int, size_t, word, unsigned long

Arduino Boolean and the Arithmetic Operators

Next to sketch and control, you must know some Boolean and arithmetic operators to command the programs.

The operands: is equal to (=), addition (+), subtraction (-), multiplication (*) and division (/).

Advanced operands: is not equal to (!=), less than or equal to (<=), greater than or equal to (>=), remainder (%).

 

Time

delay( )
delayMicroseconds( )
micros( )
millis( )

 

Boolean Operators

! (logical not)
&& (logical and)
|| (logical or)

 

Compound Operators

%= (compound remainder)
&= (compound bitwise and)
*= (compound multiplication)
++ (increment)
+= (compound addition)
-- (decrement)
-= (compound subtraction)
/= (compound division)
^= (compound bitwise xor)
|= (compound bitwise or)

 

Bitwise Operators

& (bitwise and)
<< (bitshift left)
>> (bitshift right)
^ (bitwise xor)
| (bitwise or)
~ (bitwise not)

 

Control Structure

break
continue
do...while
else
for
goto
if
return
switch...case
while





Popular posts from this blog

GCE QUESTIONS AND SOLUTIONS FOR ELECTRICAL POWER SYSTEMS

 DOWNLOAD GCE PAST QUESTIONS AND SOLUTIONS FOR EPS POWER ELECTRONICS  Download 1     Download 1b Download 2     Download 2b      Download 2C Download 3 AUTOMATIC CONTROL OF ELECTRICAL MACHINES Download 1 Download 2 Download 3      Download 3b Download 4      Download 4b    2020 DESIGN OF ELECTRICAL INSTALLATION Download 1 Download 2 Download 3      Download 3b      Download 3C      Download 3D CIRCUIT ANALYSIS Download 1 Download 2 Download 3 Download 4 ENGINEERING SCIENCE Download 1 2019 Download 2 2023 paper 1 Download 3   MOCK      Download 3B  Download 4         Download 5          Download 6 Download 7   ITV ELECTRICAL AND ELECTRONIC CIRCUIT  Download 1 ELECTRICAL DIAGRAM Download 1   CAP ELECTRICAL TECHNOLOGY AND DIAGRAM Download 1 Download 2   ITV ELECTRICAL POWER SYSTEMS SOLUTIONS Download Solutions ELECTRICAL MACHINES  Download 1  ITV Download 2   MOCK Download 3   EE4 ENGINEERING DRAWING Download 1 ITV SOLUTIONS CIRCUIT THEORY Download 1

Download GCE syllabus | scheme of work all subjects

GCE syllabus secondary education Cameroon  570 Mathematics ♻️DOWNLOAD 570 Math 📲 575 Additional Mathematics ♻️DOWNLOAD Additional Mathematics📲 775 Further Math 🆓 Download Further Mathematics📲 Physics Ordinary Level 🆓 Download Physics Ordinary Level 📲 Physics Form 3-5 🆓 Download Physics Form 3 to Form 5 📲 Physics New Form 1 to 2 🆓Download Physics Form 1 and 2 📲 530 English Language 🆓 Download English Language 📲 540 Food and Nutrition 🆓DOWNLOAD FOOD AND NUTRITION 📲 545 French 🆓DOWNLOAD FRENCH 📲 590 Logic 🆓 LOGIC 📲 Chemistry Form 1 to Upper Six 🆓 DOWNLOAD CHEMISTRY Form 1 to U6📲 Chemistry Second Cycle 🆓Download CHEMISTRY Second Cycle📲 Geography  🆓DOWNLOAD GEOGRAPHY 📲 Geography Form 3-5 🆓DOWNLOAD GEOGRAPHY Form 3 to 5📲 History, Geography, Citizenship Form 1-2 🆓Download HISTORY, Geography, CITIZENSHIP📲 Geology 🆓Download  GEOLOGY 📲

GCE Advanced Level Past Questions Power Electronics

  GCE Advanced Level Past Questions   Technical and Vocational Education Examinations Electrical Power Systems EPS Power Electronics Specialty Name (Specialty Code) Electrical Power Systems EPS (F3) Subject Title   Power Electronics Paper Nº   2 Subject Code Nº 7235  1.  Control of a D.C motor          The circuit shown in figure 1, include the control and the power circuit of a DC motor to make the up and down movements of a system. All the OP-AMP and switches are ideal a)   Study of the control circuit (OA1; R’s and (AO2). i)       Give the operating mode of the operational amplifiers (OA1; R’s) and (AO2).                  ( 6 marks) ii)      prove that the expression of the voltage at the OA1  inverting input terminal in function of V 1  and V 01  is  V- = ( V 1  + V 01 ) / 2         (6 marks) iii) Prove that the expression of the voltage a