Can't get Mega working with simple LED light on

Recently I brought an Arduino Mega board. I can't figure out to get this working with simple LED blink. Here is my code:

/*
Simple LED sketch
*/

int led = 13; // Pin 13

void setup() {
pinMode(led, OUTPUT); // Set pin 13 as digital out

// Turn on the LED
digitalWrite(led, HIGH);
}

When I upload and I get error message. I tried change pin like 12 or 11. but it didn't work.

Here is error message which I couldn't figure it out.

C:\Users\REIDDE~1\AppData\Local\Temp\ccoGeTMK.ltrans0.ltrans.o: In function `main':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:47: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

I checked to make sure it is working with com. My computer is Win10. Am I missing something? I have update the driver and it didn't gives me any error message.

My the way I looked at the Arduino Mega board which has GEEKCREIT label on it.

Where is your loop() function?

First, after 53 posts you should know how to use code tags to properly post your source code here. Second, every sketch needs a loop() function in it. Yours doesn’t.

Hi,

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Tom... :slight_smile:

I am so embarrass on this. I thought I did copy all the codes on this. Sorry I thought this new board might have missing bootloader or driver on it. But I was wrong. I had some bad wires. I finally got it working. I took out all the old wires out and start over again and use the new wires.

No no no no, don't blame the wires, always blame yourself :wink:

.

larryd:
No no no no, don't blame the wires, always blame yourself :wink:

My Harley had some run-ability issues. It would run fine most of the time, but now and then it would stumble and hesitate and run like crap. Never happened while it was anywhere near the dealer, of course.

They were, I think, beginning to not believe me. Until, finally, one day, it was in the shop for a new tire, and it did it to them while they were moving it back out front.

Turned out to be a broken wire at the tip sensor. When the wire made contact, which it did most of the time, the trike ran fine. When it didn't, the computer thought the trike was tipping over, so it thoughtfully shut the engine down. Why a trike has a tip sensor is a mystery in itself.

Replacing the wires fixed that problem. It was NOT my fault. I am blaming the wires.

That's a good one.

But when I rewired the circuit, it worked, it must have been the wires.

But when I rewired the circuit, it worked, it must have been the wires.

Well, its perfectly obvious that most of those wires are too short AND the wrong color. Obviously they should ALL be orange.

Had a tractor that would stop shortly after running.
Turned out to be a mouse was in the gas tank, it would get sucked up to the gas line, tractor stopped, mouse floated away, this would repeat over and over.

I blamed the mouse, not the fact that someone left the gas cap off over night.

.

larryd:
.
Turned out to be a mouse was in the gas tank, it would get sucked up to the gas line, tractor stopped, mouse floated any, this would repeat over and over.

There should be a punishment for reminding me …

I bought two new Vetus diesel fuel filters for 2 single cylinder Yanmar engines for a catamaran. Both of the filters had some casting flash across the fuel outlet. Enough fuel got through when bleeding the system so I could start the engines and everything seemed fine. But after 5 or 10 minutes running one or both engines would stop. That was no fun as a novice sailor trying to navigate out of Dublin port without getting run down by a car ferry. The short term solution was to feed the engines directly from a fuel can.

When I eventually figured what the problem was all I needed to do was poke a screwdriver into the fuel outlet.

…R

larryd:
Had a tractor that would stop shortly after running.
Turned out to be a mouse was in the gas tank, it would get sucked up to the gas line, tractor stopped, mouse floated away, this would repeat over and over.

I blamed the mouse, not the fact that someone left the gas cap off over night.

.

Are you going to blame the mouse for the lack of image in post #7?
Tom... :o :o :o