Skip to content

Commit

Permalink
Dikshit/chimera load bank power supply upgrade (#1336)
Browse files Browse the repository at this point in the history
### Changelist 
<!-- Give a list of the changes covered in this PR. This will help both
you and the reviewer keep this PR within scope. -->
Just fixed some sample code to reflect two channels on the Power supply
instead of one
### Testing Done
<!-- Outline the testing that was done to demonstrate the changes are
solid. This could be unit tests, integration tests, testing on the car,
etc. Include relevant code snippets, screenshots, etc as needed. -->
Tested on Power Supply
### Resolved Tickets
<!-- Link any tickets that this PR resolves. -->
  • Loading branch information
DJ90864 authored Sep 11, 2024
1 parent 8044bdd commit c11fb27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion validationtools/validationtools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .chimera import *
from .scope import *
from .loadBank import *
from .powerSupply import *
from .powerSupply import *
15 changes: 15 additions & 0 deletions validationtools/validationtools/powerSupply/_powerSupply.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,18 @@ def get_id(self) -> str:
returns: string, device identification
"""
return self.ps.query('*IDN?')

# Example usage
if __name__ == "__main__":
power_supply = PowerSupply()
print(power_supply.get_id())
# power_supply.set_voltage(5.0) # Set voltage to 5V
power_supply.set_current(1.51, 2)
power_supply.enable_output(2)

time.sleep(5)

current = power_supply.measure_current(2)
voltage = power_supply.measure_voltage(2)
print(f"Voltage: {voltage} V, Current: {current} A")
power_supply.disable_output()

0 comments on commit c11fb27

Please sign in to comment.