Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CH340 USB to TTL Serial Adaptor Then Connecting Max232 Then Connecting ATMEG Chip 328P I am able to send the singnal but I am unable

CH340 USB to TTL Serial Adaptor Then Connecting Max232 Then Connecting ATMEG Chip 328P

I am able to send the singnal but I am unable to upload my program code to the chip by using the above serial communication device! Help me to sort out the problem Folowing are the codes!

void setup() {

// put your setup code here, to run once:

Serial.begin(9600);

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);

pinMode(11, OUTPUT); } void loop() {

// put your main code here, to run repeatedly:

int val = Serial.read() - '0' ;

if (val == 1)

{ Serial.println ("on");

digitalWrite (13, HIGH);

}

else if (val == 0)

{

Serial.println("OFF");

digitalWrite(13, LOW);

}

if (val == 2)

{

Serial.println ("on");

digitalWrite (12, HIGH);

}

else if (val == 3)

{

Serial.println("OFF");

digitalWrite(12, LOW);

}

if (val == 4)

{

Serial.println ("on");

digitalWrite (11, HIGH);

}

else if (val == 5)

{

Serial.println("OFF");

digitalWrite(11, LOW);

}

while (Serial.available() == 0 );

Serial.println(val);

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

What is the use of bootstrap program?

Answered: 1 week ago

Question

What is a process and process table?

Answered: 1 week ago

Question

What is Industrial Economics and Theory of Firm?

Answered: 1 week ago