Show Posts
Pages: 1 ... 74 75 [76] 77 78 ... 100
1126  Using Arduino / Programming Questions / Re: why no curly brackets in blink without delay ? on: August 23, 2011, 04:17:03 pm
that was my first thought, but its a bit obvious
1127  Using Arduino / Programming Questions / Re: why no curly brackets in blink without delay ? on: August 23, 2011, 10:54:41 am
My granchildren can do 15 divide by 3 or 5,   or 8 minus 3 or 5 very easily , and cheap   smiley-cool

1128  Using Arduino / Programming Questions / Re: why no curly brackets in blink without delay ? on: August 23, 2011, 08:50:58 am
var = 8 - var;     looks the easy
1129  Using Arduino / Programming Questions / Re: why no curly brackets in blink without delay ? on: August 23, 2011, 05:43:52 am
OK so how does that work, and are Mr Gammon's expensive less than my dividing ?
1130  Using Arduino / Programming Questions / Re: why no curly brackets in blink without delay ? on: August 23, 2011, 04:50:33 am
I'll think about it when I have finished my rush job, it sounds like a " take away the number you first thought of" question  smiley-razz
1131  Using Arduino / Programming Questions / Re: why no curly brackets in blink without delay ? on: August 23, 2011, 04:44:23 am
I am a newbie remember, bu t is it something like  x = 15/ x   ???
1132  Using Arduino / Programming Questions / Re: why no curly brackets in blink without delay ? on: August 23, 2011, 04:14:01 am
thank guys,  that makes sense, and the     ledState = !ledState;    is so self explanatory I will stick to that in future.
1133  Using Arduino / Programming Questions / why no curly brackets in blink without delay ? on: August 23, 2011, 03:11:31 am
I have always used curley brackets around both if and else instructions, as per reference,  but I have just noticed that there are none in the if/else part of the blink without delay example.

  // if the LED is off turn it on and vice-versa:
    if (ledState == LOW)
      ledState = HIGH;
    else
      ledState = LOW;

Whats the difference / advantage?
1134  Using Arduino / Networking, Protocols, and Devices / Re: VirtualWire without PTT ? on: August 22, 2011, 01:23:35 am
I usually use the ptt output to power the Tx, it comes up in plenty of time not to miss any data, and the TX only draws about 10mA.
This way there is no quiescent current drawn by the Tx, even the cheapy ones, between transmissions.

In my current project, I needed 18 pins as input/outputs, so I generated my own ptt from one of my scanning line outputs charging a cap via a diode to keep the TX on, which works fine. ( the ptt of the Tx is 1Mohm impedance )

Even if you dont use the PTT, it seems the VirtualWire setup sets it as an output, ( and the Rx pin 11 as an input,) but I have found you can simply change them back after the VWsetup instruction.

re the serial pins DIO0 and DIO1, I have always been wary of touching them, in case I couldn't reprogram the chip later, but it seems it is OK to use the  DIO0  RXD pin as an input for something else, but I have gone back to using pin 11 again,just in case,  after resetting it to an output.

Meanwhile I wasted half the weekend again due to my confusion with where to use INT, BIN, HEX ,CHAR,BYTE ,    :-)

I got it right in the end, but when I get some spare time I will study it properly again..
1135  Using Arduino / Networking, Protocols, and Devices / Re: VirtualWire without PTT ? Hi Z output pin11 solved on: August 21, 2011, 09:47:36 am

The VirtualWire seems OK with my using pin 10 for one of my switch scanning outputs, but meanwhile pin 10 seems to have a high impedance output ..

I have four 22k pulldown resistors on pins 10, 11 , 12 and 13.

Three of them give 4v output ( on 4v5 batteries ) but pin 11 only gives 1v !  If I switch the switch off ( no load ) it goes to 4v.

Its wasnt the chip socket, or the chip, or the wiring.

If I ran Blink with pin 11 as output it goes to 4v regardless of the 22k being switched to ground or not !

If I took out the VirtualWire from the ketch, the voltage came right.

I then realised that VW setup resets pin 10 to an input, ( I had previously set it as output ) so I declared it an output again after the VW setup and all is well.

Th 22 k pull down resistors were dropping the voltage across the internal pull-ups.

There are 2 other ways I found to get round it,  one is swapping pin 11 with one of my input pins, and the other that I took a gamble on was setting the ( unused) Rx pin as pin 00 ( the rxd pin used in programming it )  but it still works OK with the serial link.  I think setting it as an output will stop you getting back into the chip ?



1136  Using Arduino / Networking, Protocols, and Devices / VirtualWire without PTT ? on: August 20, 2011, 07:47:37 am
I have had a look at the VirtualWire pdf sheet, and it tells me that ptt is default to pin 10, and you can change it to what you want.
But I have a project that I need all the pins to avoid changing harware, so can I just not set ptt in setup, and use pin 10 for something else?

Or must I try looking in the library and see if I can see whats happening, perhaps just delete this from the library ?

   // Set the digital IO pin to enable the transmitter (press to talk)
    // Defaults to 10
    extern void vw_set_ptt_pin(uint8_t pin);

    // By default the PTT pin goes high when the transmitter is enabled.
    // This flag forces it low when the transmitter is enabled.
    extern void vw_set_ptt_inverted(uint8_t inverted);


I can generate ptt from one of the other signals to switch on the Tx module.

1137  Using Arduino / Storage / Re: EEPROM overwite previous data? on: August 16, 2011, 03:08:14 am
Thanks Bob,, that's been superseded by Time.h  which I tried, but it didnt like hours and minutes, so I think I must just rename them in the sample you gave me, and I should be rolling.....
1138  Using Arduino / Storage / Re: EEPROM overwite previous data? on: August 15, 2011, 11:21:29 pm
The only library I have open is Wire,  how do I get Unixtime?
I have tried now() and (unix_time);
but it says not defined...
1139  Using Arduino / Storage / Re: EEPROM overwite previous data? on: August 15, 2011, 06:52:54 am
Of course, thanks Paul

Would the Wire.requestFrom(RTC_address,4 )   be the same, as the number of files is the same ( 4 ) , but one is 4 bytes ?
1140  Using Arduino / Storage / Re: EEPROM overwite previous data? on: August 15, 2011, 05:02:55 am
I could get the unix time, convert it to days, and subtract most of  the days to make say Aug 1 2011 the datum , then I will have more manageable number to play with for many years to come.....
Pages: 1 ... 74 75 [76] 77 78 ... 100