Show Posts
Pages: 1 [2] 3 4 ... 106
16  Using Arduino / Networking, Protocols, and Devices / Re: Anlog transmission over long distance on: July 22, 2014, 10:05:43 am
Why convert the digital signal back to analog? What sort of analog display would you use to read the analog value?

You could use, for example, a 2x16 LCD display with each column displaying the level of one LDR.

Pete
17  Using Arduino / Programming Questions / Re: A C vs C++ trivia question about integer constants on: July 20, 2014, 09:04:56 pm
In the case of the shift operators, I don't think it matters whether the number of bits being shifted is specified as long or 16-bit int - what matters is the type of the number being shifted.
Code:
// This results in zero
long foo = 1 << 16;
// This also results in zero
foo = 1 << 16L;
// but this gives 65536
foo = 1L << 16;

Pete
18  Community / Website and Forum / He's back! on: July 20, 2014, 05:07:50 pm
Unless my tired old eyes deceive me, Nick Gammon is back and is a global moderator.
http://forum.arduino.cc/index.php?topic=256037.0

Welcome back Nick.

Pete
19  Using Arduino / Programming Questions / Re: A C vs C++ trivia question about integer constants on: July 20, 2014, 04:22:56 pm
Post a sketch which demonstrates the bogus results.

This sketch prints 65536 as expected:
Code:
void setup(void)
{
  Serial.begin(9600);
  while(!Serial);

  long result;
  long r = 1;
  result = (r << 16);
  Serial.println(result);
}

void loop(void)
{
}

Pete
20  Using Arduino / Storage / Re: Unable to work with 1Mbit EEPROM on: July 20, 2014, 12:43:04 pm
Quote
I can't address the upper 64K bytes of the memory
You can't be setting the B0 bit correctly so post an example of your code which tries to address the upper 64k - in [code] [/code] tags please.

Pete
21  Using Arduino / Storage / Re: Teensy 3.1 / Data Logging / SD Card / Latency / Non-Blocking SDFAT Library on: July 20, 2014, 12:34:52 pm
You'd probably be better off asking in the PJRC Teensy forum.
http://forum.pjrc.com/forum.php

Pete
22  Using Arduino / Sensors / Re: O2 sensor to Arduino Uno on: July 20, 2014, 11:02:22 am
Quote
no O2, right?
Wrong. Complete combustion will just leave excess O2. But if the smokestack is working properly, it doesn't matter what goes up the chimney. The problem occurs if the chimney is blocked somehow and combustion products are emitted into the garage. IMO you need a carbon monoxide (CO - not CO2) detector in the garage. You must also ensure that there is sufficient air flow in the garage to provide sufficient O2 to the stove to minimize the possibility of CO production.
You must also check to find out what local building codes apply to the installation of a stove.

Pete


23  Using Arduino / Programming Questions / Re: Help concatenating *chars on: July 19, 2014, 10:10:20 pm
str needs to be declared as a character array with enough room to hold all the characters that you are storing, plus the null on the end. Try:
Code:
char str[24];

Also, this statement:
Code:
  strcpy (str,lineId);
is going to give you problems because lineId is not a string. Either change it to a string or use sprintf to convert it to a string.

Pete
24  Using Arduino / Programming Questions / Re: bitshift left (<<) gives unexpected results on: July 19, 2014, 03:53:31 pm
Code:
unsigned long BitShift = 1 << n;

The "1" is an integer constant which, by definition of the C/C++ language, is 16-bits.
You need to make it a long integer "1L". There are a couple of other places in your code where this occurs too.

Pete
25  Using Arduino / Sensors / Re: Default DS18S20 example returns perplexing results on: July 18, 2014, 08:52:49 pm
I have a Teensy 3 with 3 DS18B20 (with a 4.7k pullup). The example code in your first post correctly identifies each one and reads the temperature with no problem.

Pete
26  Using Arduino / Sensors / Re: GPS Module not working. on: July 17, 2014, 09:16:00 pm
You have wired the GPS Tx pin to pin 4 on the UNO but your code specifies pin 2 as the RXPIN. Try changing the code to this:
Code:
#define RXPIN 4

Pete
27  Using Arduino / Programming Questions / Re: problem in using interrupts on: July 17, 2014, 04:10:12 pm
Quote
the other lead of switch to 5v
That is why nothing happens when you press the switch. The pin is at 5V and you switch it to 5V.
Connect the other lead to GND.

Pete
28  Using Arduino / Programming Questions / Re: Equation giving different results on: July 17, 2014, 09:34:53 am
@James C4S: Rather than acknowledge that your statement was wrong and move on, your first response on the issue is an ad hominem attack. Classy.

Pete
29  Using Arduino / Sensors / Re: Default DS18S20 example returns perplexing results on: July 16, 2014, 10:15:08 pm
Quote
not using parasitic power
But the code does use parasite power. Change this:
Code:
ds.write(0x44, 1);
to this:
Code:
ds.write(0x44, 0);

Pete
30  Using Arduino / Audio / Re: Arduino midi drums, midi issue...... on: July 16, 2014, 10:24:04 am
I retract that comment. I realized after I had posted it last night, that it may not be obvious just how illegible yellow is. If you preview your post, the yellow shows up very clearly because the background colour used in a preview is not the same as that used in the final message.
You can edit your post (use the Modify option) and, if you must use a different colour at all (but why bother?), change the tag from color=yellow to something legible such as color=red.

But, please don't use yellow.

Pete
Pages: 1 [2] 3 4 ... 106