Newer
Older
glitch-o-bolt / ConfigChall02.py
  1. ######
  2. # LEAVE THESE IMPORTS!
  3. ######
  4. import functions
  5. import random
  6. from textual.widgets import Log
  7.  
  8. ######
  9. # config values
  10. ######
  11.  
  12. SERIAL_PORT = '/dev/ttyUSB0'
  13. BAUD_RATE = 115200
  14.  
  15. LENGTH = 42
  16. REPEAT = 1
  17. DELAY = 0
  18.  
  19. ###
  20. # ^ = pullup, v = pulldown
  21. ###
  22. triggers = [
  23. ['-', False], #0
  24. ['-', False], #1
  25. ['-', False], #2
  26. ['-', False], #3
  27. ['-', False], #4
  28. ['-', False], #5
  29. ['-', False], #6
  30. ['-', False], #7
  31. ]
  32.  
  33. ###
  34. # name, enabled, string to match in output, function to run
  35. # if string is blank ("") doesnt show toggle, just run button
  36. ###
  37. conditions = [
  38. ["Flag", True, "ctf", "stop_glitching"],
  39. ["Chal2", True, "Hold one of", "start_chal_02"] # requires bolt output gpio pin 0 -> challenge board chall 2 button
  40. ]
  41.  
  42. ######
  43. # Custom functions for conditions to trigger
  44. ######
  45.  
  46. def stop_glitching():
  47. elapsed = functions.get_glitch_elapsed()
  48. functions.glitching_switch(False)
  49. functions.add_text(f"[auto] glitching stopped (elapsed: {elapsed})")
  50.  
  51. def start_chal_02():
  52. functions.run_output_high(0, 30000000) ## can also run_output_low() if need too
Buy Me A Coffee