0% found this document useful (0 votes)
4 views11 pages

VisualStudio Python Lab

Uploaded by

Vijay Kanavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views11 pages

VisualStudio Python Lab

Uploaded by

Vijay Kanavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Python

Programming in
Visual Studio
IDE
Lab Session for Automation & Robotics
Department
Instructor: [Your Name]
Objectives

 Learnto create and configure Python


projects in Visual Studio
 Writeprograms for Velocity & Wheel
Rotations
 Run, compile (interpret), and debug
code
 Handle input/output for robotics
applications
📸 Placeholder: Robot + coding diagram
Visual Studio IDE for
Python

 Rich editor (syntax highlighting,


IntelliSense)
 Built-in debugging tools
 Supports multiple Python environments
 Used in robotics for structured
development
📸 Screenshot Placeholder: Visual Studio
'Create New Project' screen
Project Properties

 Choose Python interpreter


 Set startup file (velocity_calculator.py)
 Manage libraries (math, numpy,
pyserial)
 📸 Screenshot Placeholder: Python
Environment Selection window
 📸 Screenshot Placeholder: Solution
Explorer with project files
Writing the Program

 Example: Velocity Calculator


 📸 Screenshot Placeholder: Editor with code typed
in
Running the Program

 Python is interpreted (no compile step)


 Run with:
 • F5 = Run with debugging
 • Ctrl + F5 = Run without debugging
 📸 Screenshot Placeholder: Terminal showing
program output
Debugging the Program

 Breakpoints → pause program


 Step Into/Over → run line by line
 Watch Window → inspect variables
 📸 Screenshot Placeholder: Breakpoint at 'velocity
= distance / time'
 📸 Screenshot Placeholder: Variables panel showing
values
Input & Output

 Input: via keyboard, file, or sensor (serial)


 Output: console, logs, motor controller commands
 📸 Placeholder: Diagram of Robot (sensor → Python
program → motor output)
Example Lab Workflow

 1. Create project 'RoboticsLab'


 2. Add velocity_calculator.py
 3. Run & test with distance = 10 m, time = 2 s
 4. Debug with time = 0
 5. Add wheel_rotation.py
 📸 Screenshot Placeholder: Step-by-step sequence
(project → run → debug)
Robotics Applications

 Velocity Calculator: controls robot speed


 Wheel Rotation Calculator: precise navigation
 Debugging: prevents runtime errors during
movement
 📸 Placeholder: Robot wheel + motion diagram
Conclusion

 Visual Studio IDE → structured, safe Python development


 Students learn programming, debugging, I/O
 Direct robotics relevance: motion control, navigation,
safety

You might also like