Show Posts
Pages: 1 2 3 [4] 5 6 ... 23
46  Using Arduino / Programming Questions / Re: LOW = HIGH and HIGH = LOW on: July 16, 2013, 09:50:21 pm
her look at these for-loops , they do the same thing as your code but much less typing.

Code:
void setup()
{
  DDRD |= 0x7C ; //set to output
  PORTD |= 0x7C; //initialize them all on
}
void loop()
{
  //turn off one by one with a 1 sec delay
  for (int i = 2 ; i <= 6; i++)
  {
    digitalWrite(i,LOW);
    delay(1000);
}
   //turn on one by one with a 1 sec delay
  for (int j = 6 ; j >= 2; j--)
  {
    digitalWrite(j,HIGH);
    delay(1000);
  }
}
47  Using Arduino / Programming Questions / Re: Bit Registers on: July 14, 2013, 10:38:38 pm
http://www.fourwalledcubicle.com/AVRArticles.php really good tutorial on timers
48  Using Arduino / Programming Questions / Re: VirtualWire.h arduino on: July 14, 2013, 09:52:56 pm
i would assume

Code:
if (vw_have_message() == true)
{
}

i havent used Vwire though
49  Using Arduino / Programming Questions / Re: error messages when modifying code on: July 14, 2013, 09:45:00 pm
perhaps check the placement of your curly brackets....?
50  Using Arduino / Programming Questions / Re: quick bitwise question regarding << operator on: July 11, 2013, 11:43:54 pm
oh if understand correctly then the actual shifting is just a mask to use with the or ? which then if true sets the bit
51  Using Arduino / Programming Questions / quick bitwise question regarding << operator on: July 11, 2013, 11:18:54 pm
everytime i read code and they want to set a bit they write

Code:
DDRB |= (1 << 0); // Set LED as output
TCCR1B |= (1 << WGM12 ); // Configure timer 1 for CTC mode
// TODO : Set compare value for a compare rate of 1Hz
TCCR1B |= ((1 << CS10 ) | (1 << CS11 )); // Start timer at Fcpu /64

but when i see that i think the following

lets say this is Register B and in the first line he does an OR left shift so the way i understand (or misunderstand) that is as follows
00000000 <--starts like this
00000001 <---then a 1 is shifted zero times to the left so it stays
so whats the "Or" for ?
and could he not just write 0x01 ?

then in the next 2 lines of code he does more shifting but this time twice to the TCCR1B register  doesnt the second  shift sort of mess up everything he did in the first place?
or does the fact he labeled exactly what bit he wanted "CS10" and "CS11" only modify those bits..if so then why do the whole shifting thing? if you know you needed all those bits in there why not just send a hex?
it confuses me  how he does an |= then again another  |  in the parenthesis  on top of that hes shifting everything to the left...


52  Using Arduino / Programming Questions / Arduino Extension by VIsual Micro on: July 10, 2013, 11:12:16 pm
the Arduino Extension to Atmel Studio by Visual Micro is pretty sweet!!
i am not sure if its old or new because i never checked out the extension manager before

Remember earlier i posted i was having trouble switching IDE because of some AVRDUDE error and was having to use tinyISP
well now with this extension added to my Atmel studio

I can program in an Arduino enviroment , meaning upload to the boards without use of a programmer in Wiring language  , also i just point it to the Arduino libraries and its all there
has buttons for the serial monitor to pop up as well as a frame with the online documentation and example code for the libraries etc...

I just like it because now i can use the arduino enviroment and avr c programming all in one IDE. just thought i would let you know, i know theres a couple of you who use Atmel studio.
53  Community / Bar Sport / Re: Is this a valid ticket, or not? ... on: July 10, 2013, 02:22:31 pm
I have had plenty of these when i go to Magic Kingdom or other parks in Orlando, this is just a receipt for a FastPass ticket.
and you are only allowed to get one every hour or two hours or something like that.

So when he put his Entrance ticket into the Machine trying to get another fastpass ticket, the Machine gave him this message saying  "you already have(hold) one of these tickets, you cant get another one untill 1:25pm" not in those words but basically thats what its saying
54  Using Arduino / Microcontrollers / Re: Arduino as ISP Programmer, using Atmel Studio 6 on: July 09, 2013, 11:13:38 pm
same thing was happening to me in the beginning even though im using tinyISP , i just keep it on release all the time now. you know somehwere there is an installer that ports all or most libraries from Arduino to work on the atmel studio, i just can think of the name or place i saw it.

You mean this one? https://arduinotemplateexpress.codeplex.com/



Yes sir. thats it. I installed it but i have never tried using it, i feel like it defeats the purpose of trying to learn the inner workings and how to program these chips
if all I do is rely on others libraries , while useful , i would like to learn exactly how to communicate via 2wire or spi etc...... so thats my reason for using atmel and because it natevly supports programing for all their chips even the ones with the ARM cores
55  Using Arduino / Microcontrollers / Re: switching from Atmel studio to Arduino IDE = AvrDude out of Synch on: July 09, 2013, 10:42:00 pm
well i found a work around, just upload with tinyISP and then plug it in through the regular usb and i can still read my serial print outs through the monitor
56  Using Arduino / Microcontrollers / switching from Atmel studio to Arduino IDE = AvrDude out of Synch on: July 09, 2013, 10:16:31 pm
Since i am in the process of trying to learn how to use Atmel studio for my own purposes
I have go back to the Arduino IDE when i want to work on  a project
but every single time, and now its just annoying me , the Arduino gives me an
Quote
"avrdude: stk500_getsync(): not in sync: resp=0x00"
error.
 
the only way i get it to work is by burning the bootloader again using my usbTinyISP

I also use the usbTINYISP to upload the sketches or rather the hex file when using Atmel .
I can only upload Sketches from the Arduino IDE using the usbTINY and going to "upLoad with programmer" option
the problem with that is that i lose the ability to use my serial monitor for debugging.
so then i have to burn the bootloader in order to plug the UNo board directly through usb and get my serial monitor back...

any ideas as to why its giving me this error when i try to use the board directly through its usb
57  Community / Bar Sport / Re: A new programming Language. on: July 09, 2013, 08:16:24 pm
I remember Borland Delphi , almost identical to Visual Basic
that was pretty easy to learn and start making windows applications.


Do you think that exposure to BASIC can mutilate your mind? haha

No more than equal time spent in manacles and chains with dirty, scratched goggles on.


this got me into looking into the current version and it seems pretty powerful and still a breeze to get the GUI going hassle free, specially for phone applications. hmm i might get a demo now..
58  Community / Bar Sport / getting his masters in CS at age 17 on: July 09, 2013, 11:46:54 am


dammit why couldn't i have popped out the womb a genius
59  Community / Bar Sport / Re: A new programming Language. on: July 09, 2013, 11:34:27 am
I remember Borland Delphi , almost identical to Visual Basic
that was pretty easy to learn and start making windows applications.


Do you think that exposure to BASIC can mutilate your mind? haha
60  Using Arduino / Microcontrollers / Re: Arduino as ISP Programmer, using Atmel Studio 6 on: July 09, 2013, 09:22:04 am
same thing was happening to me in the beginning even though im using tinyISP , i just keep it on release all the time now. you know somehwere there is an installer that ports all or most libraries from Arduino to work on the atmel studio, i just can think of the name or place i saw it.
Pages: 1 2 3 [4] 5 6 ... 23