Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

project on traffic light

Status
Not open for further replies.

hanukaran

New Member
now i wan sen data to be shown in pc.I use visual basic for that. im using Atmega 32 to programme the traffic light..i have the programme ready and its function well..now the problem how to write the coding to send the data to rs232..if let say the red_1 blink its mean '1'...how to send it via rs 232 and max 232 to my visual basic software...can anyone help me...i have attached my coding and my schematic of circuit and the interface..anybody please help me
 

Attachments

  • c coding and visual.txt
    4.6 KB · Views: 178
  • interface.jpg
    interface.jpg
    19.9 KB · Views: 217
  • traffic light circuit.png
    traffic light circuit.png
    144.5 KB · Views: 237
#include <mega32.h>
#include <delay.h>

#define red_1 PORTA.0
#define yellow_1 PORTA.1
#define green_1 PORTA.2
#define RXD PORTD.0
#define TXD PORTD.1


void main(void){
PORTA=0x00;
DDRA=0xFF;
PORTB=0x00;
DDRB=0x03;
PORTC=0x00;
DDRC=0xFF;
PORTD=0x00;
DDRD=0xFF;



while (1)
{
red_1=0;
green_1=1;
delay_ms(1500);
green_1=0;
yellow_1=1;
delay_ms(1500);
yellow_1=0;
red_1=1;
delay_ms(1500);
};
}



how to edit this so that i can send data to rs232 from atmega32
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top