Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 225
61  Using Arduino / Programming Questions / Re: Binary String to base ten int on: July 12, 2014, 06:27:39 pm
Convert it to a char array, and calculate it yourself.

Code:
{ '0',  '1', '0', '0', '1', '1, '0', '0', '\0'}

Subtract '0' from each element to get the decimal value. Start with a total of 0, and loop through each element, adding the decimal value for the element to your total. Left shift the total by 1 before moving to the next element.

sscanf() might also work.
62  Using Arduino / Programming Questions / Re: Understanding time.now() on: July 12, 2014, 06:14:43 pm
I'm sure it has something to do with the type of variable the now() function returns

It returns a time_t variable, which is unsigned.
63  Using Arduino / Programming Questions / Re: Void Setup on: July 12, 2014, 04:53:43 pm
The questions you're asking can't be answered without raising more questions and confusion, given your level of knowledge. You should look at understanding what a function is, how they're used, their purpose, etc.
64  Using Arduino / Programming Questions / Re: Out of memory on: July 11, 2014, 08:31:17 pm
Code is too large to fit in the code window.

Perhaps reading the thread entitled How to use this forum - please read. would give you an idea on what to do in this circumstance.
65  Using Arduino / Project Guidance / Re: Saving My Sensor data to Arduino on: July 11, 2014, 12:00:12 pm
I plan on deploying 30 of these sensors, so the sd card approach gets expensive.
I would like to have csv formatted data, it does not have to survive a restart.
I would like one minute intervals, but i can mange 5 min intervals.

Thanks Arrch

You don't want to store the data in CSV format on the nodes, because that is going to be expensive on the memory. Keep it in binary form and only convert it to CSV when it's ready to get written to a file.
66  Using Arduino / Project Guidance / Re: Saving My Sensor data to Arduino on: July 11, 2014, 10:50:19 am
Arduninos do not have file systems, so they have no concept of what a CSV file will look like. You can have CSV formatted data, but where you store it will depend on how much data you need to store, how often you are storing it, and whether or not it needs to survive a power cycle.
67  Using Arduino / Programming Questions / Re: 8 channel relay programming problem on: July 11, 2014, 10:32:07 am
Code:
       // send data only when you receive data:
        if (Serial.available() > 0) {
                // read the incoming byte:
                incomingByte = Serial.read();
                 ...
        }
        ...
        if (Serial.available() > 0) {
                // read the incoming byte:
                incomingByte = Serial.read();
                ...
        }

Two separate reads in the loop, means you're leaving it up to chance as to which one is going to read the byte. Imagine a fighting couple share a mailbox and check it at different times of the day. If the husband gets a letter addressed to the wife, he throws it out. If a wife gets a letter for the husband, she throws it out. In this scenario you have to time when you drop the letter in, to make sure it goes to the write person. You need to mend the relationship so that only the wife gets the mail. She checks to see if it is addressed to her, if not, she gives it to her husband who checks to see if it's addressed to him. If not, he throws it out.
68  Using Arduino / Programming Questions / Re: Relay not activating – help please on: July 10, 2014, 06:00:38 pm
can anyone point me at a resource(s) that looks at moving the project of the breadboard and  onto something more long term permanent.

Look into perfboards or stripboards.
69  Using Arduino / Programming Questions / Re: Error after adding a few extra line, probably something REALLY simple on: July 10, 2014, 05:52:28 pm
To be honest, Im not. I know very little, very new to this.

Here's a quick explanation, but you would be better off finding a tutorial online to get the full breadth of information.

Each left curly brace '{' (called the opening brace) needs an associated right curly brace '}' (called the closing brace). Any line of code between that is in the same block of code. Typically, these are only used after function implementations:

Code:
void setup()
{

}

if statements

Code:
if (someConditionIsTrue)
{

}

and loops

Code:
while (someConditionIsTrue)
{

}

Not only is your code missing braces, but it has extraneous pairs:

Code:
void setup() {
   {  
  pinMode(egtled, OUTPUT); //Define EGT high LED  
  pinMode(piezo, OUTPUT); //Define EGT high piezo  
  pinMode(speedsignal, OUTPUT); //Define speed signal switch  
 }

Notice two opening braces and one closing one. Anything within the first opening brace (next to setup()) will be part of the setup function, so the following opening brace, and its associated curly brace is pointless unless you know what you're doing with the scoping (you don't and it's so rare that I couldn't even think up an example where it would be used).
70  Using Arduino / Programming Questions / Re: Error after adding a few extra line, probably something REALLY simple on: July 10, 2014, 05:40:43 pm
You're missing curly braces, and apparently aren't familiar with the concept of them, judging by the code.
71  Using Arduino / Programming Questions / Re: Input and Output Tables on: July 10, 2014, 09:26:53 am
@CrossRoads
I wouldn't even want to write out all that.

I wouldn't either. I would put the values in excel and try to find a best fit formula.
72  Using Arduino / Programming Questions / Re: ah man Noob asking a question again... on: July 09, 2014, 07:22:52 pm
so an INPUT_PULLUP takes use of internal resistors and inverts the signal and.. converts value of said signal?

... What?

INPUT_PULLUP sets the pin as input and enables the internal resistor on the pin. That means that if nothing is connected to a pin, it will read as HIGH. If you want to connect a momentary switch to it, you connect one pin to the digital switch and the other to GND. Then, when the switch is pressed, the pin is shorted to GND and digitalRead will return LOW.
73  Using Arduino / Programming Questions / Re: if statement within a switch case?? on: July 08, 2014, 06:20:34 pm
so how to i integrate the two switch cases?

By combining them in a way that makes the code do what you want it to do.

(General questions get general answers)
74  Using Arduino / Programming Questions / Re: noob questions about i2c on: July 08, 2014, 05:03:33 pm
No.  Type int is a 2-byte number which runs from -32000 to +32000 ( whatever ),    and unsigned int is 0 to 65000

0 to 255 is a 1-byte number.

If we were talking about the potential values of variable types, you're post would be relevant. Since we're talking about the values being spat out by a stream, it isn't.
75  Using Arduino / Programming Questions / Re: noob questions about i2c on: July 08, 2014, 04:47:24 pm
makes perfect sense also means all int values will need to be between 0 and 255 if im not mistaken

-128 to 127 for int
0 to 255 for unsigned int
Pages: 1 ... 3 4 [5] 6 7 ... 225