I need help I am new. could someone rewrite this for me so it works!?

C:\Users\Eddie\AppData\Local\Temp.arduinoIDE-unsaved2025422-12184-5ykbtt.yp4l3\sketch_may22d\sketch_may22d.ino: In function 'void loop()':
C:\Users\Eddie\AppData\Local\Temp.arduinoIDE-unsaved2025422-12184-5ykbtt.yp4l3\sketch_may22d\sketch_may22d.ino:10:3: error: 'DigiKeyboard' was not declared in this scope
DigiKeyboard.sendKeyStroke(KEY_T, MOD_CONTROL_LEFT);
^~~~~~~~~~~~
C:\Users\Eddie\AppData\Local\Temp.arduinoIDE-unsaved2025422-12184-5ykbtt.yp4l3\sketch_may22d\sketch_may22d.ino:10:30: error: 'KEY_T' was not declared in this scope
DigiKeyboard.sendKeyStroke(KEY_T, MOD_CONTROL_LEFT);
^~~~~
C:\Users\Eddie\AppData\Local\Temp.arduinoIDE-unsaved2025422-12184-5ykbtt.yp4l3\sketch_may22d\sketch_may22d.ino:10:30: note: suggested alternative: 'SREG_T'
DigiKeyboard.sendKeyStroke(KEY_T, MOD_CONTROL_LEFT);
^~~~~
SREG_T
C:\Users\Eddie\AppData\Local\Temp.arduinoIDE-unsaved2025422-12184-5ykbtt.yp4l3\sketch_may22d\sketch_may22d.ino:10:37: error: 'MOD_CONTROL_LEFT' was not declared in this scope
DigiKeyboard.sendKeyStroke(KEY_T, MOD_CONTROL_LEFT);
^~~~~~~~~~~~~~~~
C:\Users\Eddie\AppData\Local\Temp.arduinoIDE-unsaved2025422-12184-5ykbtt.yp4l3\sketch_may22d\sketch_may22d.ino:14:30: error: 'KEY_N' was not declared in this scope
DigiKeyboard.sendKeyStroke(KEY_N, MOD_CONTROL_LEFT);
^~~~~
C:\Users\Eddie\AppData\Local\Temp.arduinoIDE-unsaved2025422-12184-5ykbtt.yp4l3\sketch_may22d\sketch_may22d.ino:14:30: note: suggested alternative: 'SREG_N'
DigiKeyboard.sendKeyStroke(KEY_N, MOD_CONTROL_LEFT);
^~~~~
SREG_N
C:\Users\Eddie\AppData\Local\Temp.arduinoIDE-unsaved2025422-12184-5ykbtt.yp4l3\sketch_may22d\sketch_may22d.ino:18:3: error: 'Digikeyboard' was not declared in this scope
Digikeyboard.sendKeyStrokes(KEY_F4);
^~~~~~~~~~~~
C:\Users\Eddie\AppData\Local\Temp.arduinoIDE-unsaved2025422-12184-5ykbtt.yp4l3\sketch_may22d\sketch_may22d.ino:18:31: error: 'KEY_F4' was not declared in this scope
Digikeyboard.sendKeyStrokes(KEY_F4);
^~~~~~
C:\Users\Eddie\AppData\Local\Temp.arduinoIDE-unsaved2025422-12184-5ykbtt.yp4l3\sketch_may22d\sketch_may22d.ino:18:38: error: expected '}' at end of input
Digikeyboard.sendKeyStrokes(KEY_F4);
^
exit status 1

Compilation error: 'DigiKeyboard' was not declared in this scope

Here is the code
void setup() {

}

void loop() {
// New tab
DigiKeyboard.sendKeyStroke(KEY_T, MOD_CONTROL_LEFT);

// New window
DigiKeyboard.sendKeyStroke(KEY_N, MOD_CONTROL_LEFT);

//Fullscreen toggle
Digikeyboard.sendKeyStrokes(KEY_F4);

Welcome to the forum!
Try writing #include "DigiKeyboard.h" on a line at the start of the sketch, and writing } on a line at the end of the sketch.

ok i did that using the library and now im getting error code exit statis 1
this is what it looks like now after the changes

#include <DigiKeyboardBe.h>

void setup() {

}

void loop() {
// New tab
DigiKeyboard.sendKeyStroke(KEY_T, MOD_CONTROL_LEFT);

// New window
DigiKeyboard.sendKeyStroke(KEY_N, MOD_CONTROL_LEFT);

//Fullscreen toggle
Digikeyboard.sendKeyStrokes(KEY_F4);
}

There is a simple trick:
Run the tutorials and learn how the libary works .

Wrap your code in a code block...

Change occurrences of DigiKeyboard to DigiKeyboardBe.

E.g.

DigiKeyboardBe.sendKeyStroke(KEY_T, MOD_CONTROL_LEFT);

i did that and im getting "exit statis 1"

this is what the code looks like now
#include <DigiKeyboardBe.h>

void setup() {

}

void loop() {
// New tab
DigiKeyboardBe.sendKeyStroke(KEY_T, MOD_CONTROL_LEFT);

// New window
DigiKeyboardBe.sendKeyStroke(KEY_N, MOD_CONTROL_LEFT);

//Fullscreen toggle
DigiKeyboardBe.sendKeyStrokes(KEY_F4);
}

If you want to keep my attention, please edit your posts and attach the code how it should be
(see #5).

yea, i dont know how to do that, could you do it?

i dont know where to put it, could you do it?

Do what?

put it in code blocks

Please correct your posts and add code tags around your code.

There is a small pencil image below your existing posts.

  • click on this pencil āžœ that will let you edit your post.
  • Select the part of the text that corresponds to the code
  • Click on the <code/> icon in the toolbar to indicate that it is code
  • click image Save Edit

(Also make sure to properly indent the code in the IDE before copying and pasting it here. This can be done by pressing ctrlT on a PC or cmdT on a Mac)

Do yourself a favour and please read How to get the best out of this forum and post accordingly …

Maybe because you did not do what I suggested, you did something different. Good luck with getting your code to work! :waving_hand:

What occurs when you follow the instructions in Post #13 and Post #5?

#include "DigiKeyBoard.h"




void setup() {
unsigned long start = millis();
while (millis() - start < 900000) {
  DigiKeyboard.sendKeyStroke(KEY_N, MOD_CONTROL_LEFT);
  DigiKeyboard.delay(200);
  }
}
void loop() {
  //


}

Does it "compile?" (click the check mark)

(yes, everyone noticed you changed it from the first few posts)

#include <DigiKeyboardBe.h>





void setup() {
unsigned long start = millis();
while (millis() - start < 900000) {
  DigiKeyboard.sendKeyStroke(KEY_N, MOD_CONTROL_LEFT);
  DigiKeyboard.delay(200);
  }
}
void loop() {
  //


}

so i changed the #include to the board in my library but now im getting this error code

In file included from C:\Users\Eddie\AppData\Local\Temp\.arduinoIDE-unsaved2025423-2980-4z2y5r.x2p8h\sketch_may23a\sketch_may23a.ino:1:0:
c:\Users\Eddie\Documents\Arduino\libraries\DigiKeyboardBe\src/DigiKeyboardBe.h:1:10: fatal error: DigiKeyboard.h: No such file or directory
 #include "DigiKeyboard.h"
          ^~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1

You must install the correct library. Spelling.

so everywhere it says digiKeyBoard i should change it to DigiKeyboardBe.h ??