Week 5 – RAYYA HOSN AND CHARLIE BRADLEY

 

IT’S THE FINAL COUNTDOWN

 

This week we worked on refining our code and our model. Due to the issue of the stepper motor not stopping, and the absolute function not registering we’ve had to review our concept and make minor changes to work out how to work it.

THE CODE

Being the main thing that drives the motor, we started with the code. Instead of using a absolute function, we have edited the code to simplify the process of modulating the outcome of a formula. This can be shown below:

int light = _last – _current;
if (light < 0) light = light + light * 2;

What this code does is make sure that all of the differences between numbers are positive. This will link in to our other code, which checks if this number is larger than the threshold, which would then activate the stepper motor again. This part of the code can be found below:

if (_last == _current || light < threshold) isChanged = false;
return isChanged;

We also learnt about tabs, how introducing tabs to the code can simplify the complexity of the code, and make sure everything is in its proper place without compromising the code itself. We have used tabs to separate the stepper motor’s code from the rest of the code to ensure no tangling is endured.

To view the code for this section click here.

FLOWCHART ON HOW IT WORKS

Picture1.png

FRITSING

This shows the current set-up of our Ardunio board:

Flower 1_bb.jpg

MODEL

ezgif-2-724b93524a.gif

The model has been made out of card to ensure the motor is able to animate the flower. If wood were to be used it would been to much force for the stepper motor to move.

Each of the petals are connected to the pulley located on the motor. Each time the motor turns the string will become taught and animate the arms.

IMG_20170218_175746.jpg

We created a container for the Ardunio to be placed in, also to support the motor. We also included a hole, so that we can control when the change in light takes place.IMG_20170218_175751.jpg

In order to ensure the readings from the light sensor was accurate, we changed the light sensor to be more advanced. This light sensor already had a resistor built into it, so removed the clutter found on the breadboard further.

IMG-20170217-WA0003.jpeg

A video of the working model can be viewed here.

WHAT DIDN’T WE DO?

Unfortunately due to the time constraints we were not able to fulfil all of our desired requirements. We were not able to install the speaker, which was due to the long amount of time that was spent on trying to fix the code. I feel that if we were to take this forward we would focus more on the form of the model, making it look more like a rose.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s