Help Code CSGO bomb

December 19, 2023, 10:17

jaxon1710

an the pins and equipment i just need python code bc i am still figureing out how to code python for this

k9t33n

I'm guessing this is gonna be fake lol?

k9t33n

I can help with the code tho

jaxon1710

Yes

jaxon1710

OMG you can that wold be appricated soo much

jaxon1710

can we talk in DMs

k9t33n

why?

k9t33n

why not here?

jaxon1710

though it would be easyer but anyway

k9t33n

i prefer it here, also this is used for a database so its better here

jaxon1710

oh yeah okay makes sense

k9t33n

anyway, first get started with what keypad do you have?

jaxon1710

So i got all the parts in this kit, i prob have some other laying around

jaxon1710

i am asuiming it would look somthing like this if i get it to work https : //www.reddit.com/r/csgo/comments/16b0bwb/csgo_bomb_irl/

k9t33n

do you have something specific for the keypad?

k9t33n

like a diagram or something?

jaxon1710

sorry i am new to this but like how do i find a diagram or somthing like that

k9t33n

this said it has one for everything in the kit

jaxon1710

yeah it does it has like a key pad in it

jaxon1710

want me to take a photo irl or somthing like that

jaxon1710

also thank you soo much for youre help

k9t33n

np

k9t33n

sure

jaxon1710

I don’t 5ink the back would of helped but it is there if you need it

jaxon1710

<@1071178789939331253>

jaxon1710

Lol my printer tells me when the raspberry pi turned on and it only does it for the pi

k9t33n

oh no i dont mean that

k9t33n

lol, i didnt know printers has that ability

jaxon1710

Sorry I sm new what did you mean

k9t33n

was there any paper in the thing this came in to explain how to use any of this?

k9t33n

dw

jaxon1710

there was a 460 page tutorial that showed you howto power it and the code to do cpu usages

jaxon1710

do ou want me to send you the pdf

k9t33n

sure we can try it

jaxon1710

to big, do you want me to send a download link

jaxon1710

and the page fr the screen is 247

k9t33n

ok, ill have to read later

jaxon1710

okay thanks

jaxon1710

<@1071178789939331253> the keypad is on page 266

k9t33n

okay

jaxon1710

just ping me when you need alr

k9t33n

ok

jaxon1710

This is the code if it helps (for the screen)

jaxon1710

<@1071178789939331253>

k9t33n

does this code work at all?

jaxon1710

Yeah

jaxon1710

i can show you if you want

jaxon1710

the first time i started it, it didnt work then i started it up again then it worked

k9t33n

ok... so what do you need with?

jaxon1710

wdym?

jaxon1710

like i want the code that can make it work like the csgo bomb but without exssploding of course

k9t33n

ok so let's go back a bit. what does this program do?

jaxon1710

display the temp and time

jaxon1710

temp of cpu

jaxon1710

and it came in the tutorial

k9t33n

oh ok. ill have to help you tomorrow now tho. so cya later

jaxon1710

yeah all good, it is morning for me now so i might not be on or i will be on late at night

k9t33n

look through and find out how to get which keys are pressed if you can. that's all we need then were set

jaxon1710

yup okay thanks]

jaxon1710

<@1071178789939331253> Can you help me fix this cooked coede

jaxon1710

<@1071178789939331253> i am not using the code above i have some code but idont think it would work

k9t33n

i can just tell they were a bit lazy with the api for this, they didnt even use their own just 2nd handed others

k9t33n

anyway, we shouldnt need that. do you know how to detect key presses?

jaxon1710

Ive got the code that came the key that detects when it is pressed.

k9t33n

ok could you share it?

jaxon1710

yup sure one seco

jaxon1710

It comes with 2 files for some reason, i think it needs both but i havent tried it when it is on its own

jaxon1710

<@1071178789939331253>

k9t33n

yeah ik

jaxon1710

sorry

jaxon1710

<@1071178789939331253> it also comes with these

k9t33n

interesting. once I work how the hell that works we can pretty much do etherything because we can see the screen code in the other code bit

jaxon1710

so they have the code then they have GPIOZero code so this GPIO code so will send the normal in a sec but they both worik]

jaxon1710

The normal code need a adafrut code

jaxon1710

i showed my mate and he couldnt figure it out lol]\

k9t33n

ooh, it is a pretty annoying api as I mentioned

jaxon1710

is there a way we could scrap the api or use a different api to make it easyier

k9t33n

it's possible but it probably won't be easier

k9t33n

can you run these lot and show me what it does?

k9t33n

like just the first one mainly

jaxon1710

Do you want me to screen rec it or somhing like that

k9t33n

you don't have to, just run it press a few buttons on the keypad and screenshot the answer

jaxon1710

yeah okay

jaxon1710

<@1071178789939331253> i gotta re wire it sorry i might be a while

k9t33n

np

jaxon1710

<@1071178789939331253> sorry i took so long one row didnt work so i had to trouble shoot but got it working i used matrixKeypad.py

k9t33n

ah ok that makes it simpler

k9t33n

ok we can use that

jaxon1710

okay nice, what should i do now?

k9t33n

im creating some code which should work

jaxon1710

Oh okay nice thanks, do you want me to do anything with the screen wet?

k9t33n

no it's alright, I'm just adding the two code snippets together so it should display what key your pressing

jaxon1710

Yeah alright thanks, i asked chat gpt to do that and it shat the code. btw but git isnt working well, it works someties but more times there is a heap of errors

k9t33n

try this

k9t33n

keep in mind I just created this on mobile so it probably will have a couple errors in it

jaxon1710

yeah all good, i am testing it now

k9t33n

Great!

jaxon1710

When i start it in the termail it keeps saying program s starting like spaming it

jaxon1710

Program is starting ... 
Program is starting ... 
Program is starting ... 
Program is starting ... 
Program is starting ... 
Program is starting ... 
Traceback (most recent call last):
  File "/home/Pi/Downloads/Newfolder/keypad.py", line 247, in <module>
    loop()
  File "/home/Pi/Downloads/Newfolder/keypad.py", line 221, in loop
    key = loop()
          ^^^^^^
  File "/home/Pi/Downloads/Newfolder/keypad.py", line 221, in loop
    key = loop()
          ^^^^^^
  File "/home/Pi/Downloads/Newfolder/keypad.py", line 221, in loop
    key = loop()
          ^^^^^^
  [Previous line repeated 989 more times]
  File "/home/Pi/Downloads/Newfolder/keypad.py", line 217, in loop
    lcd.setCursor(0,0)  # set cursor position
    ^^^^^^^^^^^^^^^^^^
  File "/home/Pi/Downloads/Newfolder/Adafruit_LCD1602.py", line 100, in setCursor
    self.write4bits(self.LCD_SETDDRAMADDR | (col + self.row_offsets[row]))
  File "/home/Pi/Downloads/Newfolder/Adafruit_LCD1602.py", line 170, in write4bits
    self.pulseEnable()
  File "/home/Pi/Downloads/Newfolder/Adafruit_LCD1602.py", line 183, in pulseEnable
    self.GPIO.output(self.pin_e, False)
  File "/home/Pi/Downloads/Newfolder/PCF8574.py", line 67, in output
    self.chip.digitalWrite(pin,value)
  File "/home/Pi/Downloads/Newfolder/PCF8574.py", line 38, in digitalWrite
    self.writeByte(value)   
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/Pi/Downloads/Newfolder/PCF8574.py", line 26, in writeByte
    self.bus.write_byte(self.address,value)
RecursionError: maximum recursion depth exceeded while calling a Python object


------------------
(program exited with code: 1)
Press return to continue

jaxon1710

now it is saying errors

k9t33n

that'd actually make sense since it's in a loop

k9t33n

ok this is happening because a loop is getting called by a loop. not good

jaxon1710

Yeah that what i figured when it stared,so i am assumed it was that, is the keypad also reading ada fruit that is for the screen and thats why it cause the errors?

jaxon1710

<@1071178789939331253>

k9t33n

should be

jaxon1710

do you know how to fix it?

k9t33n

I should be able to. can't rn tho

jaxon1710

yeah all good, just tell me when you can or if i can help]

k9t33n

ok

jaxon1710

i got a working script.

jaxon1710

I just have a question would you be able to make the led in the second script that ill attach blink when it is counting down?

jaxon1710

<@1071178789939331253>

jaxon1710

I got somthing but it gives out errors, can you help please?

k9t33n

sure, well done for doing it though

jaxon1710

I got it working completly thank you for helping me out

k9t33n

np

k9t33n

even the timer?

jaxon1710

do you want a demo of how it works rn?

jaxon1710

yuo

k9t33n

sure why not

jaxon1710

alright i will get a vid rq

jaxon1710

please dont mind the wiring

k9t33n

ok cool, well done

k9t33n

I wont dw

jaxon1710

<@1071178789939331253> just don’t mind all the crap

k9t33n

nice

k9t33n

quick question. have you sorted so if you get the right password it cancels and set up for something to happen once the timer goes off?

jaxon1710

I don’t know actually my mate told me like some well words I would use and I figured it out lol sorry

jaxon1710

Any ideas I am thinking of getting sound working

k9t33n

I've never really made sound with my pi

k9t33n

you would need a speaker

jaxon1710

In my kit it has the components and a speaker which is good

k9t33n

ok good

jaxon1710

Do you know how to trigger audio? In the code

jaxon1710

Okay thanks

k9t33n

download a beep or an explosion or something on the pi and copy it's path. then follow the rest of the instructions

jaxon1710

Okay makes sense thank you soo much

k9t33n

np

jaxon1710

<@1071178789939331253> do you hav any ideas

jaxon1710

also <@1071178789939331253> do you think it is good/effichent enough to make a youtube tutorial on?

k9t33n

no not really

k9t33n

you yourself? sure

jaxon1710

yo should i put a switch in?

k9t33n

sure why not. it's your project so you decide

jaxon1710

how would i impullment it?

k9t33n

what do you want the switch to be for?

jaxon1710

i guess turinging it on. i ment like in the code?

k9t33n

oh, I would take the lazy way out really and put the hole thing in a while loop then if statement so that when the switch is pressed it activates the code

jaxon1710

Yeah okay

k9t33n

let me code that for you rn

jaxon1710

tysm, do you want the script or do you have it?

k9t33n

I'm thinking rn

k9t33n

researching and thinking

k9t33n

okay I'm going to act like it's a button

k9t33n

so it would be like this

k9t33n

yeah if I do it like that it's really simple

k9t33n

py
import gpio zero
button = button(gpio pin)
button.wait_for_press()
<code here>

jaxon1710

yeah okay i will give it a go, so it goes on the top?

k9t33n

yes

k9t33n

you could optimise it by putting it after the modules tho

jaxon1710

so weres that sorry

jaxon1710

<@1071178789939331253>

k9t33n

yk the things that start with "import" then a name

k9t33n

after them

jaxon1710

okay