Tenth week's Assigment
For this week, the assignments to be accomplish are:
- Made an Input board that measures something
- Learn something new
Making Schematics and Drawing
I feel more confident making boards and understanding how they work even including the the AVR programming but I still dont understand a lot of parts of the code, I think that that biggest challenge of the academy has been recreating Neil's board using Arduino IDE and making my own code.
on the right I did not found the option for a 1x4 pins in eagle so I had to re-draw it in the illustrator.
As you can see using a image processor software you can
This is how to board looks
This board pushed to learn more about the contraints of the Tiny boards regarding the Serial communication and how we should donwload and #include few libraries, these links help me to understand All About Libraries and to understand what libraries are including how to use them such as
Software Serial communication when phisically the pins need to be assign by software and
SendOnlySoftware Serial.
Making and designing the board was not too difficult but make to do what you want is the key factor and took me a lot of trial en error, Also realize that having more people working in the same problem can help to find a solution faster.
Thank you to Hyejin SenOnlySoftware part that actually make the board run.
Arduino IDE and Attiny45
Code Used
the Input Code
#include
#include
int trig=3;
int echo=4;
int led=1;
//SoftwareSerial mySerial (1,2); // RX, TX
SendOnlySoftwareSerial mySerial(2); // Tx pin
void setup() {
// put your setup code here, to run once:
mySerial.begin(9600);
pinMode(trig,OUTPUT);
pinMode(echo,INPUT);
pinMode(led,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(trig,LOW);
digitalWrite(echo,LOW);
delayMicroseconds(2);
digitalWrite(trig,HIGH);
delayMicroseconds(10);
digitalWrite(trig,LOW);
unsigned long duration=pulseIn(echo,HIGH);
float distance=duration/29.0/2.0;
mySerial.println(distance);
if (distance<10){
digitalWrite(led,HIGH);
}
else{
digitalWrite(led,LOW);
}
delay(200);
}
Lessons Learnt
What I was not able to do this week:
- This week was a lot of failures but eventually everything happend
What I did but need to get better at:
- Able to edit and make my own code
- read successfully the distance
- Understanding the laws of quantium mechanics
- Be more confident on Making squematics
| Week12 | Week14 |