WYSIWYG Web Builder
1. Operating diagram
2. Code architecture
3. Source code
Operating diagram
Code architecture
Source code
The following diagram shows how  
we conceived the functioning of  
our program:

Firstly, a sequential succession of  
actions, performed by the user, to  
update the time: [Acquire  
Time].

Secondly, the storage of the time  
into the library and the launch of  
the timer: [Set time into the  
library].

Thirdly, an infinite loop where the  
robot automatically updates the  
time and writes it every minute:  
[Extract time] & [Write  
time].

At each moment, switching off the  
power will have the effect of  
turning off the robot and erase the  
current time: [OFF].
 
 
 
Programming:
Back to the top
- int acquireTime (int stage)
The programming of the Arduino is done in the Arduino environment, which its language is  
based on C / C ++.

Moreover, this environment allows the use of various different libraries developed by the firm or  
by the user community. To take advantage of existing codes, we used two libraries:
- Stepper.h : used to control our steppers

- Time.h :  used for the time management
Returns the value put on the potentiometer  
by the user to update the time. Stage  
informs if the value to return is the low  
minute(1) [xx:xX], the high minute(2)  
[xx:Xx], the low hour(3) [xX:xx] or the high  
hour(4) [Xx:xx].
- void makeStep (int motorUsed,
  int sense, int coeffOfStep)
Here is a brief explanation about the functions we have written:
Sends the correct state (motorUsed) to the  
demultiplexer and uses an instruction from  
Stepper.h to make the motor move in the  
correct direction (sense) with an attenuation  
of the step size  (coeffOfStep) if necessary.
- void up ()
- void down()
- void right()
- void left ()
Each function calls makeStep with the  
correct parameters
- void solenoid (int state)
Sends to the numerical output of the  
solenoid its required (state): put on the  
whiteboar (1) or put off the whiteboar (0).
- void lightUpLeds (int value)
Converts the value received into binary  
sequence and lights up the leds.
Our complete code, in the .ino extension, can be found here
- void makeDigit(int digit)
Calls, according to a determined sequence,  
functions up(), down(), right(), left() and  
solenoid(state) to write (digit).  The value of  
(digit) is provided by Time.h library when  
the update of the time is done, just before  
a new writing cycle.
Back to the top
Back to the top






RoboCLOCK - Mechatronics Project

Technical Details - Programming
 
Copyright ©  "RoboCLOCK team"  ·  All Rights reserved ·  Designed for Firefox