Go Down

Topic: Can I handle with this project? (Read 423 times) previous topic - next topic

ElMacsi

Hey guys!
I´ve recently bought the Arduino Uno, and I´ve been doing some of the projects included in the book, so I´m basically a noob.
Like many others(I don´t really know how a lot of people came up with the same idea) I´ve decided to do a Morse-type project

The deal is that you have two arduino´s, one with a LED and the other with a photoresistor and a display. As you expect, the LED will flash in dot or dash  (I can handle that part) and the photoresistor will decode it and then print the letter in the display.

For a newbie like me, it´s a lot that I have to do, right?

I´m open if you want to make some recommendations about how to tackle the problem the easiest way posible.

Thanks!

OverclockedBacon

It probably wont work in a well lit room as a single LED wont change the resistance of the LDR

ElMacsi

It probably wont work in a well lit room as a single LED wont change the resistance of the LDR
I´ve though about that, but that´s not a problem, since both arduino´s will be close

PaulRB

#3
Aug 23, 2016, 11:46 pm Last Edit: Aug 23, 2016, 11:48 pm by PaulRB
There is a sort of version of Morse code that you won't have to teach the Arduino to send, it already knows it. Like Morse, each letter of the alphabet is represented as a pattern of flashes. It is called ASCII code.

ElMacsi

There is a sort of version of Morse code that you won't have to teach the Arduino to send, it already knows it. Like Morse, each letter of the alphabet is represented as a pattern of flashes. It is called ASCII code.
Wow that´s a lot of help! I knew about ASCII but I would never have imagined that it was convinient to use it.

The way that i think it would work is that if I want to send the letter "a", I have to light on the LED for 1 second, and the photoresistor as soon as it sees that some significant light comes to it, it would start counting. When the light stops, I should see the timer have counted 1 second (how can i round up? (sorry if it´s not the correct word, but what I mean if the timer is at 1.012 sec for example, transformit into 1 sec)). And then add 96(since the "a" is the number 97) to it, and print it.


Delta_G

Don't base it on time.  Send 8 bits as flashes or non-flashes.  A start and stop flash to mark where the byte begins and ends would be nice.  Basically you want to replicate how the serial line works. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

MorganS

I would even go so far as attaching the LED to pin 1 (Serial transmit) and select a very slow baud rate, like 1 or 10. It may not work that slow. There is a minimum baud rate and trying to find where that is documented will be a good learning exercise.
"The problem is in the code you didn't post."

ElMacsi

Basically you want to replicate how the serial line works.  
Could you explain me that?

Maybe if you are advanced in this kind of things, doing what you are saying would defenitely help, but in my level it may be easier with time (I can´t even handle libraries  ::) )

Thank you in advance!

s4be

Delta_G

Google up how serial data works.  Study on it a while.  You'll see.  It's just a series of pulses.
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

Delta_G

I can´t even handle libraries

You can, you just don't realize that you've been doing it all along.  Have you used the serial monitor at all?  Have you used digitalWrite or digitalRead?  Those are all libraries added just for the Arduino.  Other libraries work the same way, the only difference is that you have to write an include statement to get them to work.  Serial and wiring are included by default. 

|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

Go Up