Digistump Forums

The Digispark => Digispark Projects => Topic started by: Uthayakumar on February 03, 2017, 12:29:30 pm

Title: Send onetime Text to Computer
Post by: Uthayakumar 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);
}

Title: Re: Send onetime Text to Computer
Post by: benalb 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() {
 }
Title: Re: Send onetime Text to Computer
Post by: Uthayakumar 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)
Title: Re: Send onetime Text to Computer
Post by: Uthayakumar 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() {
}