Search code examples
arduinoarduino-ide

Arduino program does not work with Proteus


I wrote an Arduino program for the simulation in Proteus. I have an Arduino mega 2560 board and 7-segment cathode. I want the 7-segment to show number "8". I already compiled Arduino program and copied the path of .hex file to put on the board. When I run the simulation, the 7-segment does not light up; however, the simulation was running with no errors. I am very new to this. help me please.

Proteus, Arduino mega 2560, 7-segment cathode

void setup() {
  pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
}
void loop() {
  digitalWrite(0, 1);
  digitalWrite(1, 1);
  digitalWrite(2, 1);
  digitalWrite(3, 1);
  digitalWrite(4, 1);
  digitalWrite(5, 1);
  digitalWrite(6, 1);
}

Solution

  • Mine worked very well, have you chosen the Atmega2560 processor in Arduino IDE? Arduino IDE

    This is the picture of a working schematic: Proteus

    Why isn't it working on your device?