import was't declared in the scope error

Trying to write a program that will measure the temperature and save results in a file.
What im doing wrong ?

#include <dht.h>

dht DHT;

#define DHT11_PIN 7

void setup(){

void loop()
int chk = DHT.read11(DHT11_PIN);
Serial.print("Temperature = ");

import processing.serial.*;
Serial mySerial;
PrintWriter output;
void setup() {
mySerial = new Serial( this, Serial.list()[0], 9600 );
output = createWriter( “data.txt” );
void draw() {
if (mySerial.available() > 0 ) {
String value = mySerial.readString();
if ( value != null ) {
output.println( value );

void keyPressed() {
output.flush(); // Writes the remaining data to the file
output.close(); // Finishes the file
exit(); // Stops the program

bazarishe: What im doing wrong ?

import processing.serial.*;

That is not a valid C++ statement.

What im doing wrong ?

Trying to create a mystical blend of Java and C++

It looks like you found some Processing code and tried to paste it into the middle of an Arduino sketch. You will often find Processing code alongside Arduino code because they make good companions when you want your Arduino program to interact with a program running on a computer.

What you need to understand is that Arduino code runs on the microcontroller on your Arduino board and is compiled and uploaded using the Arduino IDE. Processing code runs on your computer and you use it with the Processing IDE. It might be a bit confusing because the Arduino standard API was designed to mirror Processing as much as possible, so Processing code somewhat resembles Arduino code, even though Processing is Java based and Arduino sketches are compiled as C++. You can't run Processing code on your Arduino board, but you can communicate between the Arduino code running on your Arduino and the Processing code running on your computer.

For information on Processing, see: