Thanks
start code
****************************************
Code: Select all
/*
ProTrinketKeyboard example
For Pro Trinket (ATmega328 based Trinket) by Adafruit Industries
Please use library TrinketKeyboard for the ATtiny85 based Trinket
Version 1.0 2015-01-01 Initial Version derived from TrinketKeyBoardExample Mike Barela
*/
#include <ProTrinketKeyboard.h> // Ensure the library is installed
// Switches are connected from ground to these defined pins
const int PIN_BUTTON_CAPITAL_A = 11;
const int PIN_BUTTON_STRING = 12;
void setup()
{
// Declare button pins as inputs
pinMode(PIN_BUTTON_CAPITAL_A, INPUT_PULLUP);
pinMode(PIN_BUTTON_STRING, INPUT_PULLUP);
// setting input pins to high means turning on internal pull-up resistors
digitalWrite(PIN_BUTTON_CAPITAL_A, HIGH);
digitalWrite(PIN_BUTTON_STRING, HIGH);
// remember, the buttons are active-low, they read LOW when they are not pressed
// start USB stuff
TrinketKeyboard.begin();
}
void loop()
{
TrinketKeyboard.poll();
// the poll function must be called at least once every 10 ms
// or cause a keystroke
// if it is not, then the computer may think that the device
// has stopped working, and give errors
if (digitalRead(PIN_BUTTON_CAPITAL_A) == LOW)
{
//this is the section i cant get to work THANKS
TrinketKeyboard.pressKey(KEYCODE_MOD_LEFT_CONTROL, KEYCODE_MOD_RIGHT_ALT, KEYCODE_E);
TrinketKeyboard.pressKey(0, 0);
delay(1000);
}
if (digitalRead(PIN_BUTTON_STRING) == LOW)
{
// type out a string using the Print class
TrinketKeyboard.println("[email protected]");
delay(2000);
TrinketKeyboard.println("password");
}
}
end code
Thanks