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: 183
  • interface.jpg
    19.9 KB · Views: 224
  • traffic light circuit.png
    144.5 KB · Views: 240
#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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…