HELP! I suck at this! Arduino Compile Error

Hi guys,

I'm really sorry but I've never used Arduino before (ever!)

For a project, I am trying to create an acoustic levitator, found on MakeZine - Micro Ultrasonic Levitator - Make:

Done all the wiring but the missing piece in the puzzle is the code but it's not working!

Two screenshots attached; one of the code provided and one of the error. I think I'm using an Arduino Nano? (picture provided)

Any help would be greatly appreciated!

Yours Noobily,

Dan

Screenshots of code are worthless. I cannot put the code into an editor for examination. Read the how to use this forum-please read stickies to see how to post code and error messages. Following the guidelines will save everyone time and get you faster and better help. Also read #11 to get an idea of the information that will help us help you.

What does "not working" mean?

danielangove:
Done all the wiring but the missing piece in the puzzle is the code but it's not working!

Unless you are very very fortunate don't assume that there are no wiring errors.

I know this is not welcome news but it is not a good idea to start with a complex project when you have no experience of how to debug programs.

...R

The screen shot only shows "Exit status 1" which means "There was an error." Copy and paste ALL of the text in that text box below the sketch. That will include the actual error messages.

One common beginner error is "no such file or folder" which means you didn't install one of the required libraries.

The sketch they provide doesn't use any libraries so that's not the problem.
My guess is that you copied the sketch incorrectly or you selected an Arduino that didn't have an ATmega328P processor (UNO, Mini, Nano) so some hardware register names used in the sketch aren't defined.

byte TP = 0b10101010; // Every other port receives the inverted signal

void setup()
{
  DDRC = 0b11111111; // Set all analog ports to be outputs

  // Initialize Timer1
  noInterrupts(); // Disable interrupts
  TCCR1A = 0;
  TCCR1B = 0;
  TCNT1 = 0;
  OCR1A = 200; // Set compare register (16MHz / 200 = 80kHz square wave -> 40kHz full wave)
  TCCR1B |= (1 << WGM12); // CTC mode
  TCCR1B |= (1 << CS10); // Set prescaler to 1 ==> no prescaling
  TIMSK1 |= (1 << OCIE1A); // Enable compare timer interrupt
  interrupts(); // Enable interrupts
}

ISR(TIMER1_COMPA_vect)
{
  PORTC = TP; // Send the value of TP to the outputs
  TP = ~TP; // Invert TP for the next run
}

void loop()
{
  // Nothing left to do here :)
}