Help arduino setting key

Hello, im new to the arduino scene and have a pretty big question

If anybody can help me.

I Want my relay on pin 7 to trigger on when i push DELETE keyboard key and keep on for 3 seconds then go off can anybody help me with this? pleaseee.

Welcome to the forum

Is the DELETE key that you refer to the one on the PC keyboard ?

How is the keyboard connected to the Arduino?

Yes it is

is the keyboard connected to pc

Then you will need software running on the PC that can send a signal to the Arduino that the delete key has been pressed. You presumably do not have such software

Why not simply use a button connected to the Arduino and have the user press that instead of the delete key ?

What problem are you trying to solve by detecting that the delete key has been pressed ?

So the thing that im trying to id is : i stream on tiktok and i want to make my nerf gun (wich i connected to arduino and it works with a timer (turn relay on for 3 seconds and off for 5 seconds over and over ) i wanna make it trigger on with a stroke from my keyboard because i want my viewers to be able to trigger it on through a gift from tiktok gift wich i can program through tikfinity toi simulate a keystroke so rose->DELETE->nerf gun on(relay) for 2 seconds -> nerfgun(relay) off. i dont know if i explained to well .

void setup() {
pinMode(7, OUTPUT);// connected to S terminal of Relay

}

void loop() {

digitalWrite(7,HIGH);// turn relay ON
delay(3000);// keep it ON for 3 seconds

digitalWrite(7, LOW);// turn relay OFF
delay(5000);// keep it OFF for 5 seconds

}

That's what i have so far but i need it to get on on a keystroke and then off until the keystroke is pressed again

Can tikfinity output to a serial port on the PC ?

i dont think so, it only simulates keystrokes and trigger webhooks when i get a certain gift.

What do you mean by a webhook ?

http://127.0.0.1:6721/spawn_attackers:1 like this one

I have no idea what that does apart from its name, which I don't like the look of at all

1 Like

doesn't matter its for a GTA5 so all i need its a method to make arduino turn the relay on when a key is pressed

It seems that tikfinity can connect to an IP address on receipt of a gift from TikTok

If so, then an Arduino board connected to your network could be used as the target of the connection and could receive a payload that could cause the Arduino to run code

Which Arduino board are you using ?

arduino uno

Third-Party API - TikFinity i think it can use ports or execute codes by the seeings here.

If it is a Uno R3 rather than a Uno R4 then it cannot connect to a network without extra hardware such as a network shield

Would you consider buying an ESP32 board ?

1 Like

Sounds like a job for an UNO-R4 WiFi or an ESP32

Edit: Got ninja posted by UKHB with the same info.

You can never have too much good advice :grinning:

2 Likes