Author Topic: Send onetime Text to Computer  (Read 2821 times)

Uthayakumar

  • Newbie
  • *
  • Posts: 3
Send onetime Text to Computer
« on: February 03, 2017, 12:29:30 pm »
Hi,
I have Digispark Attiny85 USB,
I need to unlock my computer by connecting the Digispark with my own password.
I wrote below program in Ardunio, but the output is not stopping, Its keepon sending the text to my computer.
Please give me a program for one time Text transfer


#include "DigiKeyboard.h"
void setup() {
}
void loop() {
  DigiKeyboard.sendKeyStroke(0);
  DigiKeyboard.print("My Password");
  DigiKeyboard.delay(5000);
}


benalb

  • Newbie
  • *
  • Posts: 9
Re: Send onetime Text to Computer
« Reply #1 on: February 03, 2017, 12:54:16 pm »
Move all lines in void loop() to void setup():

#include "DigiKeyboard.h"
void setup() {
 DigiKeyboard.sendKeyStroke(0);
  DigiKeyboard.print("My Password");
  DigiKeyboard.delay(5000);
}
void loop() {
 }

Uthayakumar

  • Newbie
  • *
  • Posts: 3
Re: Send onetime Text to Computer
« Reply #2 on: February 03, 2017, 01:32:30 pm »
Hi,
After moving the code to setup its not working (I'm not getting any response from Digispark)

Uthayakumar

  • Newbie
  • *
  • Posts: 3
Re: Send onetime Text to Computer
« Reply #3 on: February 03, 2017, 02:56:30 pm »
After adding delay in first line its works....


#include "DigiKeyboard.h"
void setup() {
  DigiKeyboard.delay(2000);
  DigiKeyboard.sendKeyStroke(0);
  DigiKeyboard.println("My password");
}
void loop() {
}