Let's Make Robots!

Xbees and rf modules

Hello guys. 

I was thinking about buying a few xbees for my lasertag project but since they're a bit costly i wanted to ask you if it fits my project before buying them.

I'll tell you what i want to to: basically lasertag is a game where there are lots of players that "shoot" at each other with IR pulses. What i wanted to add to it is some sort of "hit feedback", something, be it sound or LED, that tells me whether or not i have succesfully hit my target.

ADC and strange readings

Hello guys,

I ran this sketch that would simply read an ADC port and print it out to my pc. It went just fine and results were pretty consistent, something like: 300 300 300 300 300 299 300 300 299 300 300 and so on....

But when I use Serial.print(analogRead(whatever_pin)); in a larger sketch, results are very different, something like: 300 290 305 288  310 315 306 296 and so on. This "larger" sketch has 3 interrupt service routines, and the hardware setup has 3 different chips and a loudspeaker.

5V and 3V together

Hello!

I'm building a board that needs both 3v and 5v as it has some components working on 3v and others on 5v. Now what is the best to do in this case? I am not sure, i've analyzed some of the options but i really do not know the advantages/disadvantages of each:

- have a 5V regulator and a 3V regulator with the input connected to the 5v reg's output (could be done, the 3v reg is low dropout)

- have a 5V reg and some diodes to output 3V (or a voltage divider with resistors)

- have a 5v reg and a 3v reg with both inputs connected to the v+ on the battery 

Technical info on speakers

Hello guys. I've made a simple audio board by following the instructions provided by the "Arduino Waveshield" homepage. Only changed one part (the audio amp) but it works flawlessly.

Now, i'm using a 1W audio amplifier, and i have an 8ohm 0.5W speaker. I'm not too satisfied with the volume, as i'd like it louder than it currently is. Options are:

PWM and registers

Hello,

some time ago i had opened a forum post about PWM on arduino. RobotFreak gave me a piece of code that made my remote work:

#define pwmPin 11

void setup()  {
 
  // toggle on compare, clk/1
  TCCR2A = _BV(WGM21) | _BV(COM2A0);
  TCCR2B = _BV(CS20);
  // 36kHz carrier/timer
  OCR2A = (F_CPU/(IR_CLOCK_RATE*2L)-1);
  pinMode(pwmPin, OUTPUT);
  
}

SPI problem

Hello guys. I'm trying to make an spi connection between the arduino and an IC. Actually it's not an arduino, it's an atmega328 on a breadboard, but i'm programming it with the arduino IDE through ICSP. I've got a problem, this sketch doesn't work:

void setup(){

byte clr; SPCR=B01010011;

clr=SPSR;

clr=SPDR;  

digitalWrite(10, LOW);  //10 is basically the SLAVE SELECT pin   

spi_transfer(B00000100); //powerup delay(10);

digitalWrite(10, HIGH);  

digitalWrite(10, LOW);

spi_transfer(B00000000);  //setrec

DIY not gate

Hi, 

i tried building a not gate (1 input only), not one i saw on the internet but i tried to make one myself. The problem is i didn't succeed. Now, i know there are loads of examples of how to make one on the net, but i opened this post because i'd like to know why mine doesn't work, so i can improve, hopefully :), my electronics skills.

Here it is:

 Immagine.png

Serial transmission and when to initialise it

Hello!

 I am trying to figure out how to transmit data from one atmega to another one via IR. Oh btw i am using arduino language.

First thing i though of was setting the serial communication by using serial.begin in the setup function. I tried that and i noticed that the LED connected to the TX pin on the arduino lights up as soon as i give power to the atmega. This is not really what i wanted, cause i'd like to have the LED off when not in use.

Programming an atmega with the Arduino IDE

Hi guys.

from this post (http://letsmakerobots.com/node/5593 ) by Rudolph i learned that you can program an atmega with the arudino IDE even if you haven't got an arduino board.

What i have here with me now is an atmega328, a serial programmer (precisely this one: http://www.sparkfun.com/commerce/product_info.php?products_id=14 ).