Skip to content
Snippets Groups Projects
Commit 7d42caf4 authored by Adrián Torres's avatar Adrián Torres
Browse files

update_week14

parent 7960a26f
No related branches found
No related tags found
No related merge requests found
Pipeline #168681 passed
//code made by Adrián Torres
//Fab Academy 2020
//Fab Lab León
//ATtiny412
#include <SoftwareSerial.h>
SoftwareSerial serial_led(2, 3); //tx, rx
......
//Original code of Adrián Torres. Fab Academy 2020
//Fab Lab León
//ATtiny1614
int sensorPin = 1; // analog input pin to hook the sensor to
int sensorValue = 0; // variable to store the value coming from the sensor
......
//Original code made by Paco Gonzalez. Fab Academy 2016 and Hugo F. Garcia. Fab Academy 2019.
//Modified Adrián Torres. Fab Academy 2020
//Fab Lab León
//ATtiny1614
#include <SoftwareSerial.h>
SoftwareSerial serial_servo(5,4); //tx, rx
......
//code made by Adrián Torres
//Fab Academy 2020
//Fab Lab León
//ATtiny1614
#include <SoftwareSerial.h>
int sensorPin = 1; // analog input pin to hook the sensor to
......
......@@ -87,6 +87,8 @@
<p>For this I am going to connect the Phototransistor through the FTDI connector, using the TX and RX pins (I had to have placed other pins higher, learned the lesson 😅) and the Servo through the pins that I connected to the Serial Bus. To learn a little more about this form of communication, I am guided by the documentation of <a href="http://archive.fabacademy.org/archives/2016/deustofablab/students/60/assignment15.html"><b>Paco Gonzalez</b></a> de Deusto from 2016 and <a href="http://fabacademy.org/2019/labs/leon/students/elena-cardiel/week15.html"><b>Elena Cardiel</b></a> from Fab Lab León of 2019. </p>
<h2>- First attempt (It didn't work)</h2>
<p>Looking at the documentation, I realize that I have to <b>cross</b> the TX and the RX on one of the two boards. In other words, the TX of the photransistor with the RX of the servo and the RX of the phototransistor with the TX of the servo. Later in the Arduino program, I will use the <b>Software Serial library</b>, to use this library I have to declare which are the TX and RX pins of the ATtiny1614. Going back to my <a href="week08.html"><b>Embedded Programming</b></a> documentation for the week, the ATtiny1614 uses the TX on pin 5 and the RX on pin 4.</p>
<p>So this would be the connection with my cables.</p>
......@@ -115,6 +117,9 @@
<p>I speak to my <b>super programming guru</b> and <b>instructor</b>, <a href="https://fabacademy.org/archives/2013/students/nunez.pablo/index.html"><b>Pablo Nuñez.</b></a> We review together the first program, the phototransistor program. I tell him that when I connect it with the FTDI to the computer, no sensor values appear. Weird first thing. For this I use the program that I use in the input week. I also used the <a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/write"><b>Serial.write()</b></a>; this serves to send binary values (true or false, 0 or 1) does not serve to send ASCI values. For this you have to use the <a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/println"><b>Serial.println().</b></a></p>
<p>Once the phototransistor program has been corrected, I check if I have values for the serial via the FTDI and it is correct. I go to the servo program, from the original program I remove the serial.print(), because it is not necessary and can create confusion for the servo. I reload the program to ATtiny1614 and plug the FTDI into the board. The servo continues to vibrate and no data comes through the serial. Pablo asks me how the TX and RX connections are, I tell him they are crossed and he asks me why?</p>
<h2>- Second attempt (Works)</h2>
<p>The reason is because I saw that in Paco's scheme he did it this way; and Pablo tells me that being a bus the TX connects to the TX and the RX to the RX. So you can hang as many nodes on the bus as you want, otherwise it would be a point to point. <b>Important:</b> You do not have to cross the TX and RX cables.</p>
<p>In addition, following the assignment of <a href="http://fab.academany.org/2019/labs/ied/students/hugo-garcia/13_week.html"><b>Hugo F. Garcia,</b></a> IED student of the year 2019, I use the <b>address</b> in the Node with the number 1, so that the Bridge receives it. In the code below it can be seen.</p>
......@@ -142,6 +147,7 @@
<p><b>Phototransistor Node</b></p>
<pre><code>//Original code of Adrián Torres. Fab Academy 2020
//Fab Lab León
//ATtiny1614
int sensorPin = 1; // analog input pin to hook the sensor to
int sensorValue = 0; // variable to store the value coming from the sensor
......@@ -166,6 +172,7 @@ void loop() {
<pre><code>//Original code made by Paco Gonzalez. Fab Academy 2016 and Hugo F. Garcia. Fab Academy 2019.
//Modified Adrián Torres. Fab Academy 2020
//Fab Lab León
//ATtiny1614
#include <SoftwareSerial.h>
SoftwareSerial serial_servo(5,4); //tx, rx
......@@ -221,6 +228,7 @@ void loop(){
<pre><code>//code made by Adrián Torres
//Fab Academy 2020
//Fab Lab León
//ATtiny412
#include <SoftwareSerial.h>
SoftwareSerial serial_led(2, 3); //tx, rx
......@@ -280,7 +288,13 @@ void loop(){
<p>This would be the Arduino code.</p>
<pre><code>#include <SoftwareSerial.h>
<pre><code>
//code made by Adrián Torres
//Fab Academy 2020
//Fab Lab León
//ATtiny1614
#include <SoftwareSerial.h>
int sensorPin = 1; // analog input pin to hook the sensor to
int sensorValue = 0; // variable to store the value coming from the sensor
......@@ -332,6 +346,12 @@ void loop() {
<p><img src="images/week14/week14.10.jpg" width="70%"; max-width="700" /></p>
<h1>Files</h1>
<p>Find below the files that I made for this assignment.</p>
<ul><li><a href="assignments/week14/hello_phototransistor_node_bueno/hello_phototransistor_node_bueno.ino"> <b>Arduino Phototransistor Node</b></a>
<li><a href="assignments/week14/hello_servo_bridge_bueno/hello_servo_bridge_bueno.ino"> <b>Arduino Servo Bridge</b></a>
<li><a href="assignments/week14/hello_led_node/hello_led_node.ino"> <b>Arduino Led Node</b></a>
<li><a href="assignments/week14/mensaje_group/mensaje_group.ino"> <b>Arduino Send Message</b></a> </ul>
<h1>Final Project. Networking.</h1>
......@@ -356,19 +376,12 @@ void loop() {
<span class="image main"><img src="images/week14/week14.12.jpg" alt="" /></span>
<p>Now there is the programming part, for me the hardest, I hope to get it. 😅 💪</p>
<p>Now there is the programming part, for me the hardest, I hope to get it. 😅 💪 Working progress... </p>
<h1>Files</h1>
<p>Find below the files that I made for this assignment.</p>
<ul><li><a href="assignments/week14/hello_phototransistor_node_bueno/hello_phototransistor_node_bueno.ino"> <b>Arduino Phototransistor Node</b></a>
<li><a href="assignments/week14/hello_servo_bridge_bueno/hello_servo_bridge_bueno.ino"> <b>Arduino Servo Bridge</b></a>
<li><a href="assignments/week14/hello_led_node/hello_led_node.ino"> <b>Arduino Led Node</b></a>
<li><a href="assignments/week14/mensaje_group/mensaje_group.ino"> <b>Arduino Send Message</b></a>
<p>Find below the files that I made for the final project.</p>
<li> <a href="assignments/week14/Hello_phototransistor_bus_ATTINY412.zip"> <b>Node Phototransistor Schematic and Board ATtiny412</b></a>
<li> <a href="assignments/week14/Hello_Servo_1614_phototransistor.zip"> <b>Bridge Servos Schematic and Board ATtiny1614</b></a>
<li> <a href="assignments/week14/Phototransistor_Bus_traces.png"> <b>Node Phototransistor Traces</b></a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment