Show Posts
Pages: 1 2 [3] 4 5 ... 14
31  Using Arduino / Programming Questions / Re: Variable variable names for code tidy up? on: March 19, 2014, 02:19:54 pm
It's got arrays. It's crying for a loop.
yeah, you could be right.
32  Using Arduino / Programming Questions / Re: Variable variable names for code tidy up? on: March 19, 2014, 01:07:32 pm
I'd use classes. THere are a bunch of private like variables he's using specific to the sensor.  All he's doing now is adding a number to the variable.

33  Using Arduino / Programming Questions / Re: Variable variable names for code tidy up? on: March 19, 2014, 11:07:18 am
this is perfect situation for creating a class. Create your own class library.

Create an instance for each sensor and then loop through them all in the loop function

something like

Code:
Sensor *sensor[20];

void setup() {
    sensor[0] = new Sensor(1,2,3); // some parameter into the constructor
    sensor[1] = new Sensor(2,3,4);
   ..
  .. etc
}

void loop() {
     for (var i = 0; i < 20; i++) {
         sensor[i]->doWork();
    }
}
34  Using Arduino / Project Guidance / Re: School project- programming arduino to use touch sensors on: March 19, 2014, 07:44:07 am
I'd buy an arduino book and read.
35  Using Arduino / Programming Questions / Re: Help on coding for project! on: March 18, 2014, 06:54:00 pm
surely you jest. There are plenty of easy examples to move servos.

I'd suggest to buy some arduino books and read up on the basics.  Here's one to start with
http://arduino.cc/en/Tutorial/Sweep#.UyjfNVxdKoo
36  Using Arduino / Programming Questions / Re: Problem with Arduino mega 2560 serial port on: March 18, 2014, 10:00:53 am
The obvious difference between uno and mega are the pin numbers. I'd start looking at that.
37  Using Arduino / Programming Questions / Re: Random symbols at start of serial buffer? on: March 17, 2014, 10:11:13 pm
Try giving send a type char.
38  Using Arduino / Programming Questions / Re: Problem regarding Setup and Loop function on: March 17, 2014, 01:23:09 pm
Code:
TinyGPS gps; // create gps object
void cord(void);
void setup(){
  Serial.begin(9600); // connect serial
  Serial1.begin(4800);
 Serial2.begin(9600); // connect serial
 
  cord(); <-------------------------------------------- what is this then?
}
39  Using Arduino / Programming Questions / Re: How does programming language relate to binary code? on: March 17, 2014, 01:06:25 pm
1 & 0.

Back when the computers were first developed, they actually coded with 1 & 0 using punch cards.
I remember coding with assembly for my commodore 64. I gave up soon after.

Just be glade you're dealing with moderns languages. These codes in whatever language are then compiled, converted to 1 & 0.
Some don't need to be compiled like javascript.


40  Using Arduino / Programming Questions / Re: Problem regarding Setup and Loop function on: March 17, 2014, 12:58:52 pm
Code:
TinyGPS gps; // create gps object
void cord(void); <-------------------------------------------- what is this?
void setup(){
  Serial.begin(9600); // connect serial
  Serial1.begin(4800);
 Serial2.begin(9600); // connect serial
  
  cord();
}
 
41  Using Arduino / Programming Questions / Re: SD-card webserver on: March 16, 2014, 09:56:28 am
You can use ajax to update data from the arduino too.
42  Using Arduino / Programming Questions / Re: Uploading C files with Arduino 1.05 on: March 15, 2014, 09:19:07 pm
The easiest thing to do is include the c files as a library to the arduino sketch. Look up on how to make custom libraries.
43  Using Arduino / Programming Questions / Re: I Need To Use a Java Program To Receive Bytes From an MPU Using Bluetooth on: March 15, 2014, 09:06:27 am
actually, speaking of processing. Go to processing's forum. Lots of JAVA heads there with hardware knowledge.
\
44  Using Arduino / Programming Questions / Re: Custom class... WHAT? on: March 15, 2014, 08:16:18 am
You can use 'new' too.

Code:
Letterdata *sequence[10];
sequence[0] = new Letterdata();

Make sure to create a destructor if you need to delete it.
45  Using Arduino / Programming Questions / Re: Replacing String class . on: March 14, 2014, 02:21:45 pm
if you have a lot of or big html file to load, use the sd card, printing and coding it on the arduino is a pain.
Pages: 1 2 [3] 4 5 ... 14