FIRST GOAL (SIMPLE WIRED NETWORK)
My first goal for this week is to create a simple wired network using one board as an input to send a message to the other one with a LED attached to it as an output.
Work flow:
You can download the files:
You can download the file:
SECOND GOAL(BLUETOOTH):
My second goal is to kill two birds with one shot designing a new board that allow me to connect wired or wireless with the same input device board "limit switch" that I created for the Week 11 (mentioned before). For that I want to take advantage of this opportunity of creating a new board and catch up with the week 12 "output devices" and control a stepper motor in relationship with my final project.
Check the design process of this board in the debugging of the week 12.
INPUT / NETWORKING PROGRAMING
This time I just change the message when the switch is push instead "d" now is "0" and when the switch is released instead "u" now is "1".
You can download the file:
OUTPUT / NETWORKING PROGRAMMING
The idea is to activate the stepper motor trough bluetooth using the limit switch. For that I did the next work flow:
I start with Neil code hello stepper bipolar 44 then I review the ftdi echo hello c code that I use in the week 09 which is sending and receiving a message and copy this parts:
Te next step was to copy the part where define the serial ports and adapt to the right pins of my board:
After that I create two "IF" variable inside the main loop and copy the part where is getting a char but instead a of char i put "dato" for that I had to define "static char dato;" above.
I just copy the par that say "get char" because I just want to receive a message if I want to transmit I should copy the part that say "put char".
You can download the file:
HC-05 Wireless Bluetooth Module:
I'm using this device to attach it to my PCB and communicate them it's important to consider that this device is not at the Fab inventory so I should consider this as an extra cost for my final project. This is the work flow that I follow to make the configuration of the module.
To communicate between two bluetooth devices one must be Master and the other a Sleave. Both devices should be configured with the same paswords.
Check the video!
Goal:
For this assignment I communicate my same input board with the limit switch attached to it to communicate through a simple wired network with the Ale circuit board as an output board created in the week 12 with a RGB LED attached to it. When my switch is push will send the message "d" turning on the red light from the Ale board and when my switch is pull will send the letter "u" turning the green light on.
Output:
We had to edit a previously code made by Ale assigning the "d" and "u" char datums that her board is reading from my board and turn the green and red lights respectively.
Error: At our fist attempt nothing happens but when we connect TX with the TX and the RX with RX it works! I think the connection in my board is switched.
Check the video below!
THIRD GOAL: Push the button from one board and the LED attached to the other board blinks three times and turn off.
To achieve my goal I did the next work flow:
For the input I'm using the button attached to my board developed in the week12 debugging and I start from this hello button codes that I use to test my board and I had to make little changes in the codes:
You can download the file:
This par was a little more difficult I start from the code developed in my first goal of this assgnment and then I had to research in google about how to blink a led a number of times and I found this useful link
You can download the file:
Check the video!
Make a simple wired connection was simpler than I was expected I just need to understand the process behind and the code involved in relationship with board design.
I learn a lot making a bluetooth connection between my boards and also programming with C code it's a little hard to understand some parts but I now I understand better the logic of programming.
The bluetooth modules were easy and simple to programing using arduino software.
The difficult part for me was the programming of the main loop and the if variables but with some help now I understand better the way of thinking the programming.