Show Posts
Pages: [1] 2 3 ... 10
1  Using Arduino / Programming Questions / Re: Multiple Blinking LEDS at different intervals. on: February 01, 2014, 09:21:29 am
Thank you to every single one of you, really appreciated!
2  Using Arduino / Programming Questions / Multiple Blinking LEDS at different intervals. on: January 31, 2014, 09:53:41 pm
Hi Arduino Forum. Been a while since I wrote. I'm now in a process of creating a senior high school project. It's an awarness reminder about how we are polluting our oceans with plastic. What it will consist of is three objects, a Plastic Bottle, a Plastic Bag, and a cube of Plastic each containing a LED inside them. Every time they flash, they will represent the following:

Flash Cube of Plastic  every 3.73 seconds = 1 Tonne of plastic thrown away into the ocean.
Flash Plastic Bottle every 0.76 seconds = Equivalent of 10'000 plastic bottles thrown away.
Flash Plastic Bag every 1.53 seconds = Equivalent of 100'000 plastic bags thrown away.

This is a programming question not a project question since I would like to get a suggestion on how to flash them when each of them has a separate interval. Is there something beyond using the delay()?  A modulo function perhaps?

Please dump this post with suggestions!  smiley-razz smiley-roll-sweat smiley-sweat
Thank you!  smiley
3  General Category / General Discussion / Re: Arduino - Coding without delays using program Ticks on: December 09, 2013, 03:56:27 pm
I like how this post became into a "hot" post  smiley-razz  smiley
4  Using Arduino / Microcontrollers / Re: What pins is PORTB on the Teensy 3.0? on: December 08, 2013, 10:47:42 am
Really?  Cool; I have some Teensy3s, but I didn't realize that he had done this!
The miracles of C++, I guess; I'll have to take a look at how this was implemented.


I found some awesome sources on the pjrc Forum. Check them out if you want to play with PORTs.
http://forum.pjrc.com/threads/23950-Parallel-GPIO-on-Teensy-3-0?highlight=teensy+3.0+PORTB

especially this one:
http://forum.pjrc.com/threads/17532-Tutorial-on-digital-I-O-ATMega-PIN-PORT-DDR-D-B-registers-vs-ARM-GPIO_PDIR-_PDOR
5  Using Arduino / Microcontrollers / Re: What pins is PORTB on the Teensy 3.0? on: December 06, 2013, 07:56:20 am
"PORTB" is an AVR chip thing.  Teensy3 uses an ARM chip, which has GPIOA_PDOR as a "somewhat similar" thing.
Any Arduino code that uses PORTB will require some significant effort to run on a Teensy3 (this is "direct port manipulation", which is "underneath" the Arduino libraries.  Any compatibility between Arduino variants with different CPUs will only be for programs that use the libraries...


Thanks for this suggestion! I will certainly do some research on that one!  smiley
6  Using Arduino / Microcontrollers / Re: What pins is PORTB on the Teensy 3.0? on: December 06, 2013, 07:55:03 am
The code from a Teensy2 will not necessarily be easy to port to a Teensy3. The T3 is not just a bigger T2. It uses a completely different type of chip, an ARM Cortex M4.

That's a good point, but thank you as a start! smiley
7  Using Arduino / Microcontrollers / What pins is PORTB on the Teensy 3.0? on: December 05, 2013, 07:09:31 pm
Hi guys, I have a Teensy 3.0 board and the reason for having it is because it has 32bit processor running at 48 MHz which is much more powerful than the one on the regular Arduino's. Not mentioning that it has more memory and other goodies. And it's compatible with the Arduino IDE.

http://www.pjrc.com/store/teensy3.html

Unfortunately the problem is that it's reference info online is limited compared to the one Arduino provides. Now I'm aiming for a project with sound synthesis which I found really cool such as this one. http://little-scale.blogspot.com/2013/05/diy-polyphonic-drum-machine-and-rhythm.html

In the example the guy uses a Teensy 2.0 and I have a Teensy 3.0 board. To Anybody that knows about this board, do you know on what pins the PORTB is on?

Thank you, sorry if this post doesn't belong to the Arduino Website. Just trying to seek for some help  smiley
8  Using Arduino / Programming Questions / Re: RF 315/433 MHz Transmitter-receiver Module and Arduino? on: November 30, 2013, 09:24:12 pm
I found this video helpful. It lets you understand and write your own communication system using RF transmitters and receivers.
https://www.youtube.com/watch?v=3Rs3SJBsiYE

And here is a simple code that is more explanatory the video provides.
https://code.google.com/p/rf85/

Using Virtual Wire library is a real pain in the but.
9  Using Arduino / Programming Questions / Re: Need a time delay on: November 30, 2013, 09:20:50 pm
This article may or may not solve your problem, take a look smiley
http://bakingtechnology.blogspot.com/2013/11/arduino-coding-without-delays-using.html
10  Using Arduino / Programming Questions / Re: Temperature controller with ATTINY85 and 74HC595 on: November 30, 2013, 09:18:25 pm
Code:
  if (Tread <)

If you want the if statement to execute when the argument is true then you must just write it like this:

Code:
  if (Tread)

This way the if statement will execute if Tread is true.

11  General Category / General Discussion / Arduino - Coding without delays using program Ticks on: November 29, 2013, 02:30:53 pm
Hi Arduino Forum, I've created a helpful article on my blog that explains how to add delays to your program without actually delaying your program.

http://bakingtechnology.blogspot.com/2013/11/arduino-coding-without-delays-using.html
12  Using Arduino / Programming Questions / Sending a number instead of a Byte using RF communication. on: May 10, 2013, 11:09:13 am
Whats up Arduino forum? Recently I have managed to create a data transmitter out of an Attiny85 and a RF Link Transmiter - 4800bps (434MHz) from SparkFun. The receiver is an Arduino Uno and a RF Link Receiver - 4800bps (434MHz) connected to a computer for Serial Monitoring.  smiley-money
https://www.sparkfun.com/products/10532
https://www.sparkfun.com/products/10534

Since there are very few libraries that support Attiny85, I had to create my own transmitter and receiver code. They are extremely minimalistic, but they work pretty well! Basically the transmitter code consists of a function called byteSend() . What it does is chop up a letter that is typed into it, into bits and send the bits through the transmitter one at a time. For now, I can only send one byte at a time, so in order to create a sentence I have to create many byteSend() functions.The Receiver does the opposite of the transmitter, it collects the the bits and packs them into a byte in order to send them over the Serial Monitor. smiley-sweat

Despite the fact that transmitting letters works with my code, I eventually want to transmit temperature readings from the analog pin on the Attiny85. For this I have to convert the analog reading which is an Int, into a byte, so I can send it via the Transmitter. I tried to send one digit ints through the link but I believe they consist of two bytes so that's probably the reason why It didn't work. Here is how I did it. smiley-neutral

Code:
int d = 7;
byteSend(d);

Is there a way to convert the int into a byte that the function will be able to send? smiley-roll
Thanks guys. smiley-surprise
 
Here is the transmitter code:
Code:

 
 // Data pin that connects to the transimter's DATA IN pin
 int dataPin = 2;
 void setup(){
   // Set up the Data pin as an Output
   pinMode(dataPin, OUTPUT);
 }

 void loop(){
   // Send some bytes continuesly
   byteSend('T');
   byteSend('E');
   byteSend('S');
   byteSend('T');
   byteSend('#');
   delay(10);
 }

 // Function that will simplify the process of sending a letter
 void byteSend (byte inputByte){
    int i;
   
    // Loop that will make the reciever wake up and adjust its amplification
    for(i=0; i<20; i++){
      digitalWrite(dataPin, HIGH);
      delayMicroseconds(50);
      digitalWrite(dataPin, LOW);
      delayMicroseconds(50);
    }
   
   // A 3ms delay in order to synch the transimtter and get ready for data transmition
   digitalWrite(dataPin, HIGH);
   delayMicroseconds(3000);
   digitalWrite(dataPin, LOW);
   delayMicroseconds(500);
   
   // A loop that goes throught all the bits in a byte and transimts accordingly
   for(i=0; i<8; i++){
     
   if (bitRead(inputByte,i)==1) {
     digitalWrite(dataPin, HIGH);
     delayMicroseconds(1000);
   }
   
   if (bitRead(inputByte,i)==0) {
     digitalWrite(dataPin, LOW);
     delayMicroseconds(1000);
 }
13  Using Arduino / LEDs and Multiplexing / Re: Help with transistor and resistor selection for LED array on: May 09, 2013, 09:00:04 am
Use this link, will be very helpful next time. smiley
http://ledcalculator.net/
14  Using Arduino / Microcontrollers / Re: Decreasing the baud rate of Serial communication. on: March 21, 2013, 06:30:39 pm
Do you have to use the serial library???? I've personally used the Manchester library together with RF Link transmitter/receiver.. Without any issues.. I had the transmitter connected to the Attiny85 and the receiver to a atmega328p.. Here is the library if you want to try it out:
https://github.com/mchr3k/arduino-libs-manchester/

Never heard of it before! Thanks, I will check it out!

15  Using Arduino / Microcontrollers / Decreasing the baud rate of Serial communication. on: March 21, 2013, 06:05:12 pm
Hi Arduino Forum. Recently I've got my Attiny85 talking to the Computer through an Arduino UNO. I followed the tutorial here:
http://www.instructables.com/id/Attiny-serial-monitor-using-arduino-walkthrough/?ALLSTEPS

Everything worked perfect. I just had to connect one of the pins on the Attiny85 to the TX pin on the Arduino board. However I need to extend the capabilities of Serial communication between the Arduino and Attiny85. I want to go wireless with these RX linkers from SparkFun:

https://www.sparkfun.com/products/10534 - RF Link Transmitter (434MHz) from SparkFun for about 4$
https://www.sparkfun.com/products/10532 - RF Link Receiver (434MHz) from SparkFun for about 5$

I have them already, but they require a baud rate of less than 4800bps. I don't know why, but when I change the number in the Serial.begin() function from 9600 to some less number, it gives me an error. It says that its possible only to have a 9600, 32300 or 110000bps baud rate.

Is it possible to fix this problem, or can you suggest a way on how to get the communication working.
Pages: [1] 2 3 ... 10