'include' does not name a type

Hello when running my code I get this error message:

Arduino: 1.8.5 (Windows 7), Board: “Arduino/Genuino Uno”

sketch_feb08b:15: error: ‘include’ does not name a type

include <NewPing.h>


sketch_feb08b:28: error: expected initializer before ‘if’

if (DEBUG) { {


exit status 1
‘include’ does not name a type

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

Here is my code

  /* Copyright (c) 2015 by http://www.electrominds.com 
  * Simple Arduio Theremin "Theremino" Project 
  * Project URL: http://www.electrominds.com/projects/simple-arduino-theremin-theremino 
  * This file is free software; you can redistribute it and/or modify 
  * it under the terms of either the GNU General Public License version 2 
  * or the GNU Lesser General Public License version 2.1, both as 
  * published by the Free Software Foundation. 
  * Required libraries: 
  * NewPing: https://code.google.com/p/arduino-new-ping/downloads/detail?name=NewPing_v1.5.zip 
  * toneAC: https://code.google.com/p/arduino-tone-ac/downloads/detail?name=toneAC_v1.2.zip 
  include <NewPing.h> 
  include <toneAC.h> 
 define DEBUG         false // Set to true to enable Serial debug 
 define TONE_PIN      8 
 define TONE_VOLUME   10   // 1-20 
 define TRIGGER_PIN   12   // Board pin tied to trigger pin on the ultrasonic sensor. 
 define ECHO_PIN      11   // Board pin tied to echo pin on the ultrasonic sensor. 
 define MAX_DISTANCE  200  // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm. 

 void setup()  
   if (DEBUG) { {
     Serial.println("Theremino starting"); 
 void loop() { 
   delay(30); // Wait 30ms between pings (about 33 pings/sec). 29ms should be the shortest delay between pings. 
   unsigned long uS = sonar.ping(); // Send ping, get ping time in microseconds (uS). 
   if (DEBUG) Serial.println(uS); 
   if (uS > 2000) { // Range is about 0-30 cm from sensor 
     toneAC(0); // Turn sound off when not in range 
     if (DEBUG) Serial.println("No tone"); 
   } else { 
     int freq = 2000 - uS / 1.5; // Get sound frequency 
     toneAC(freq, TONE_VOLUME); // Play it! 
     if (DEBUG) Serial.println(freq); 

"include" and "define" are compiler directives, not programming commands. Thus you need to proceed each with a hashmark "#".

Try using #include and #define.

The same goes for tineAC.h and the if(DEBUG) error is because of the other errors.