0% found this document useful (0 votes)
13 views3 pages

Proteus

The code controls an LED and receives input from a serial connection. It displays a menu and checks for button presses or transmitted data, blinking an LED accordingly.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

Proteus

The code controls an LED and receives input from a serial connection. It displays a menu and checks for button presses or transmitted data, blinking an LED accordingly.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

digitalWrite(13,HIGH);

delay(500);

digitalWrite(13,LOW);

delay(500);

char car;

int edo;

int i;

void setup() {

Serial.begin(9600);

pinMode(13, OUTPUT);

pinMode(2, INPUT);

do {} while (!Serial.available());

car = Serial.read();

void Menu(void)

Serial.println("Elegir una de las sig operaciones:");

Serial.println("1.-Recibe");

Serial.println("2.-Transmite");

Serial.print("Escriba aqui la opcion a elegir: ");

void loop() {

Menu();

do {

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

car = Serial.read();

if (car == '1') {

Serial.println(" 1 Esta recibiendo...");

do {} while (digitalRead(2) != HIGH);

do {} while (digitalRead(2) == HIGH);

Serial.println("PRESIONADO!!!");

} else if (car == '2') {

Serial.println(" 2 Esta transmitiendo...");

do {} while (Serial.available() == 0);

car = Serial.read();

if (car == 'q') {

do {

digitalWrite(13, HIGH);

delay(500);

digitalWrite(13, LOW);

delay(500);

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

}
}

You might also like