Skip to content

MuizHamzat/2TA4-Light-Tracking-Flower

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

2TA4-Light-Tracking-Flower

A 3D-printed flower consisting of 2 servo motors and 4 light-dependent resistors (LDR). When running keyboard.cpp, in "automatic" mode, motors rotate to face the flower towards light. In "manual" mode, keyboard input is used to rotate the flowers. Running joystick.py allows for manual mode with an Xbox controller controlling rotation.

LightTrackingFlower

This is the solution to MECHTRON 2TA4 term project, requiring a cybernetic finite state machine. This machine responds to inputs coming from either the environment itself (light sources) or users within the environment (keyboard input and controller input). Using an ARM Cortex-M4 microcontroller, the specified equipment (LDRs and actuators), and the references cpp and python files, the face of the 3D-printed flower will react based on said inputs and adjust it's position.

Usage of keyboard.cpp

Connect microcontroller to your device and run the program. Flower will start in automatic mode, and will point towards the nearest light source. Moving the light source (i.e. moving your phone flashlight) will result in the motors rotating to turn the flower towards the light, based on the resistance values and comparision of perpendicular resistors. Hitting "m" on your keyboard will switch to manual mode, and allow for rotation of the flower using "w", "a", "s", and "d" keys. Clicking "m" will switch back to automatic mode.

Usage of joystick.py

Have keybaord.cpp running on your IDE, and connect microcontroller to your device. Close IDE and run joystick.py out of terminal. Connect the Xbox controller to your device. The flower will start in automatic mode. Hit "m" on your keyboard for manual mode, and rotate the flower using the left joystick on the controller. Hitting "m" again will switch back to automatic mode.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 55.0%
  • Python 45.0%