Microcontroller and Interface Programming (CSCT6102)
Computer Science - COS
Semester: First Semester
Level: 500
Year: 2015
1
REPUBLIC OF CAMEROON THE UNIVERSITY OF BAMENDA
Peace-Work-Fatherland P.O. Box 39 Bambili
First Semester Examinations
School: HTTTC Department: Computer Science Option: FCS Level: 500
Course Code: Course Title: Microcontroller interface programming and projects
Lecturer: Dr. DADA Jean-Pierre Credit Value: 2
Date: Time: 1 hour Start Time: End Time:
Exercise 1: 1) Explain each line code numbered in the following program:
#include <SoftwareSerial.h>; //(1)
SoftwareSerial mySerial(5, 10); //(2)
void setup()
{
mySerial.begin(9600); //(3)
Serial.begin(9600); //(4)
delay(100); //(5)
}
void loop()
{
if (Serial.available()>0) //(6)
switch(Serial.read()) //(7)
{
case 's': //(8)
Dada1(); //(9)
break; //(10)
case 'r':
Dada2();
break;
}
if (mySerial.available()>0)
Serial.write(mySerial.read());
}
void Dada1() //(11)
{
mySerial.println("AT+CMGF=1"); //(12)
delay(1000);
mySerial.println("AT+CMGS=\"+237699260124\"\r"); //(13)
delay(1000);
mySerial.println("Good Afternoon DOCTOR "); //(14)
delay(100);
mySerial.println((char)26); //(15)
delay(1000);
} //(16)
www.schoolfaqs.net
2
void Dada2() // (17)
{
mySerial.println("AT+CNMI=2,2,0,0,0"); //(18)
delay(1000); //(19)
} //(20)
2) Design the circuit representing this exercise
3) For the simulation in ISIS Proteus, where do we flash the *.hex file of the program?
4) With the hardware bought at Commercial Avenue, Bamenda, where do we flash the *.hex
file of the program?
5) What is the role of this entire program?
Exercise 3: Let us consider the table below representing the sequences of a junction light.
Only the diodes lighting are representing in the table.
Sequence 1 Green 1 Red 2 Red 3
Sequence 2 Yellow 1 Red 2 Red 3
Sequence 3 Red 1 Green 2 Red 3
Sequence 4 Red 1 Yellow 1 Red 3
Sequence 5 Red 1 Red 2 Green 3
Sequence 6 Red 1 Red 2 Yellow 3
The junction traffic light is represented as follow:
a) Suggest an electronic circuit able to manage that project, using Arduino borad.
b) Write al algorithm for the program
c) Write a arduino program for this algorithm
www.schoolfaqs.net