Show Posts
Pages: [1] 2
1  Topics / Home Automation and Networked Objects / Re: Sending Data to a Mysql WebServeur using POST method on: February 02, 2013, 06:29:49 pm
Quote
iDroid wrote:
$_POST is used to get values from a HTML form element with a name that corresponds to the value inside the square brackets.
This is partly true, in that what you say is a method often used, but it is not the definition of the POST method.

Using the POST method, you simply place the data, not on the url, but within the body of the http request, whether that be a html form, or for example, json encoded data from an external server/client system like an Arduino. And as such it is possible to send what ever data you have from the Arduino to a server using this method. Using the POST method also allows you to send more data than the GET method.


Oh, never knew that. Thanks.
If that isn't the problem... Then what is?
2  Topics / Home Automation and Networked Objects / Re: Sending Data to a Mysql WebServeur using POST method on: February 01, 2013, 03:12:45 pm
$_POST is used to get values from a HTML form element with a name that corresponds to the value inside the square brackets.

For example, this:
Code:
<?php 
  $Variable 
$_POST['Data'];
  echo 
$Variable ;
?>

Is now looking for a HTML element that has the name "Data", which doesn't exist.
Try writing your data into a separate text file from the arduino (remember to chmod the file) and then do something like;

Code:
<? php
$var = include 'youfilenamehere.txt';
echo $var;
 ?>
3  Using Arduino / Project Guidance / Re: SIM900 and Arduino Uno on: February 01, 2013, 02:41:08 pm
Quote
My GSM Modem can only communicate via Port 1 and 0, am i going to connect my ARDUINO UNO Pin 1 and 0 to that given pins respectively?

Arduino Uno uses those pins for serial communication, that's probably why you get garbage in the serial monitor.
As far as I know (correct me if I'm wrong though), you can't use the Serial Monitor properly if something has been connected to the RX and TX pins, at least if there's a signal coming through.

If all of the above is true, you can't use the GSM Modem on those ports if you wish to see something useful in the serial monitor.
The link you provided said it can use Recieve and Transmit on pins 2 and 3 in SUART mode, see if you can make use of that.

Or connect the GSM Module to pins 0 & 1 and don't use the serial.
4  Using Arduino / Project Guidance / Re: How to upgrade clock frequency of Uno R3? on: February 01, 2013, 02:22:51 pm
You'd need to set the fuses again, at least. I've never done this so you'll have to google it or wait for someone else's expertise.
Also decide what kind of oscillator you're gonna use (full-swing, low power, etc.) and set the voltage, caps and fuses according to the specs found in the datasheet.

With the ATTiny cores installed in the Arduino IDE, I was able to select "ATTiny2313 @ 8MHz" from the board menu, and then burn bootloader and use the chip normally. Not sure if there's an option like that for the Arduino Uno board, or if you could get ATmega328 cores with a 20MHz option.

A quick google search returned this. Don't know if it's up to date or if everything's working, I just read the few first lines.

You can also just give it a go and try, but remember the fuses.

Quote
It means that a sketch running in an Arduino Uno R3 board with 16MHz crystal oscillator, could be run 25% faster.

May I ask why do you need this 25% speed boost? I don't really see the benefit.
5  Using Arduino / LEDs and Multiplexing / Re: [Advice needed] Building a small BCD clock. on: January 21, 2013, 02:31:32 am
The pin numbers in the sketch do not match the actual pin numbers in the processor. For example, the 12th pin on the processor is referred to as 9 in the sketch.

Anyway, I had a lot of problems with the ATTiny, especially with the programming setup, so I decided that I'd switch to ATMega328. At least I shouldn't face any compatibility problems and it isn't that much bigger anyway. I guess the ATTiny could've worked with an external clock, but I'd rather not waste resources and time just to come up with another problem. Using the same processor that the Uno has seems like the best choice for now.

Just in case anyone else is having trouble programming a chip with the arduino, try making your wires shorter than 3 cm (1.18").
I don't know if that's a no-brainer for you guys, but it wasn't for me.

Other than that, I've made some nice progress. I've got the code working, the parts should be available and I've done the schematic and the board with Eagle.
Though I'm gonna have to do the board again since I made the wires a little too small.

6  Using Arduino / LEDs and Multiplexing / Re: [Advice needed] Building a small BCD clock. on: January 09, 2013, 05:03:36 am
Thanks.

Alright, I got it working and now I'm experimenting button usage with the ATTiny. Pin 12 is where the button goes and pin 11 is where an LED should light up when the input is high.
Code:
int setm;

void setup() {               
  // initialize the digital pin as an output.
  pinMode(9, INPUT);
  pinMode(8, OUTPUT); 
}

// the loop routine runs over and over again forever:
void loop() {
setm = digitalRead(9);    // Read state
    if(setm == HIGH){
      digitalWrite(8, HIGH);
      delay(250);
}
else
{
  digitalWrite(8,LOW);
  delay(250);
    }
}

However, now the LED is low when the button is pressed and when it's not, the LED just blinks. Any advice here?
7  Using Arduino / LEDs and Multiplexing / Re: [Advice needed] Building a small BCD clock. on: January 07, 2013, 03:41:34 am
Best way to explain is the code smiley

The setuploop is called in the loop() code, when we are setting the clock (initiated by a long press of the button, as a short press was used to do something else), ie. it is called repeatedy and often (until the SetClock is false)

Instead of LEDs I have a meter, you just do some visual feedback on your LEDs instead at the SetNeedle()
Code:
void setuploop() {
/* This is a small state machine, ensuring we can enter current HH:MI with one button.
  The needle is waved a bit, then wait for number button pushes that sets a single digit. */

  static byte Entry = 0 ; // State machine
  static byte N ; static byte H = 0 ; static byte T = 0 ; static byte M = 0 ;

  switch (Entry) {
    case 0: case 2: case 4: case 6: wiggle() ; Entry++ ; break ;
    case 1: if (ButtonUpd(&N)) Entry++ ; if (N>2) N=0 ; break ;
    case 3: if (ButtonUpd(&H)) Entry++ ; if (H>9 || (N==2&&H>3)) H=0 ; break ;
    case 5: if (ButtonUpd(&T)) Entry++ ; if (T>5) T=0 ; break ;
    case 7: if (ButtonUpd(&M)) Entry++ ; if (M>9) M=0 ; break ;
    case 8: SetClock = false ;
            //Store a new value in the RTC chip. Date is ignored (random)
            RTC.stopClock();
            RTC.fillByHMS(N*10+H,T*10+M,0);
            RTC.setTime();
            RTC.startClock();
            break ;
  }
}

boolean ButtonUpd(byte *Pdig) {
/* return true when no button change for several seconds. Increment argument for every button push
  put needle at value for feedback. (Wrap is handled by calling function) */

  static byte PrvBtn = HIGH ;
  byte Button ;

  SetNeedle( *Pdig, 10 ) ;
  if ( millis() - Timer > 5 && (Button=digitalRead(BUTN1)) != PrvBtn) {
    // button change, increment digit if push
    if (Button==LOW) (*Pdig)++ ;
    Timer = millis() ; PrvBtn = Button ;
  }
  return millis() - Timer >5000L ;
}

Nice, may I use it?

Alright guys, I'm back to school and now I have it all set up:
Arduino uno as ISP, trying to program ATtiny2313. All connections are triple checked, the heartbeat led is beating, the cap is between reset and ground. I uploaded the patched ArduinoISP sketch to the arduino, connected the cap and all four wires from the tiny, plus 5 volts and ground. Also connected a resistor and a led to attiny pin 2. Then I tried uploading the sketch to the tiny. No errors, but nothing happens. Tried pins 2 and 6, when it was pin 2 I set it to pin 1 in the sketch. Also tried 2. This is my second processor, since the last one gave the same error every time, so I don't think this one would be broken.

I don't need a bootloader for the tiny when I'm using the arduino as a programmer, right?
8  Using Arduino / LEDs and Multiplexing / Re: [Advice needed] Building a small BCD clock. on: December 19, 2012, 11:01:17 am
You will need to (re)set the time sometime. Daylightsaving f.ex. Or a powerloss, battery change. The "patience" was that my little onebutton algorithm involved waiting for a few secs for it to advance to the next digit and entering 9 required - yes, nine pushes.

Oh, I thought you meant pushing the minute button 60 times to advance one hour smiley-grin
Well, that's convenient enough. May I ask how did you do it?

The reference page says that this millis() function overflows after approximately 50 days, how badly does this affect the clocks accuracy?

Not at all. Search the forum, discussions on why this is not a problem constitute approximately 42% of the posts on the forum  smiley-wink

Okay, thanks!

9  Using Arduino / LEDs and Multiplexing / Re: [Advice needed] Building a small BCD clock. on: December 19, 2012, 10:40:36 am
Okay, I'll try to get one of those in my hands.

Well patience... doesn't quite belong in my vocabulary. Besides, it isn't very convenient if you have room for two buttons. I'll be setting the time in the code anyway before I upload it. I'm adding the button mainly for demonstration.
10  Using Arduino / LEDs and Multiplexing / Re: [Advice needed] Building a small BCD clock. on: December 19, 2012, 09:37:10 am
Alright, hope this post isn't too old yet, because OP is here to deliver... Somewhat.

So I got this set up on a breadbord with the Arduino Uno, just to see how the code works. I'm using the millis() function to count milliseconds from the time when the program started. Every 1000 milliseconds, it adds one to seconds, every 60 seconds it adds one to minutes and so on. Each LED is connected to it's own digital pin on the Uno and lights up accordingly with basic if functions. Right now there's only one button to set minutes on digital pin 0, but I plan to add one for hours as well when its time to shrinkify this project to the ATtiny2313. The reference page says that this millis() function overflows after approximately 50 days, how badly does this affect the clocks accuracy?

I'm building the schematic with Eagle now. Do I need any other components, suchs as caps, in order for the ATtiny to work properly?

Thanks for your help guys!

EDIT: Will the buttons work with the ATtiny? I wired them (Or "it" at this time) as instructed on this page.
11  Using Arduino / LEDs and Multiplexing / Re: [Advice needed] Building a small BCD clock. on: September 26, 2012, 10:27:08 am
atmega328, 16 mhz crystal, two 22pf caps, three 100nF caps.
14 resistors, 14 LEDs.


Thanks, but isn't the the ATmega series quite large, compared to Attiny? ATtiny 40 seems to have a max 18 I/O pins and it's definetely smaller. Do I need the crystal and caps if I'll end up using this one? What about the program to turn the leds on, can you suggest anything "smoother" than a bunch of if - structures?

A board to mount the stuff on.  And access to someone else's system with a serial line to program it. Easier if the atmega328 already has a bootloader programmed.

Right, that's pretty obvious. I've got a friend who has an Uno, so I can program the chip with it, right?
12  Using Arduino / LEDs and Multiplexing / [Advice needed] Building a small BCD clock. on: September 26, 2012, 05:49:07 am
Introductions are awkward, straight to business:

I need some advice on how to control 14 leds, with the smallest possible microprocessor. I'd rather not buy an arduino mini just for this project, as this is a school project. I haven't written any code yet, but I was thinking I could just count the time within the loop.

I discovered that it is possible to shrink your projects, by uploading your sketches into single chips, such as the ATtiny85. Now that's small enough, but it only has 6 I/O pins, and I need to control 14 leds. Unless I can find a 14 I/O chip that's relatively small, I'm going to need some help from you guys. I googled around and read something about an LED matrix, but I really don't get the idea, since it seems to require the same amount of outputs anyway. I guess it makes the code clearer.

TL;DR: What's the simplest way of controlling 14 LEDs with the smallest possible configuration?
13  Using Arduino / Project Guidance / Re: Starting a project, need some advice and confirmation. on: May 11, 2012, 11:35:42 am
Well here I am triggering a change, but the question is how I make the arduino notice the change and what is the most effective way of doing it.

14  Using Arduino / Project Guidance / Re: Can not chat in two directions using Arduino Ethernet Shield, why? on: May 11, 2012, 04:03:30 am
I see, so you're aiming for some sort of system to send messages to highly trained chimps in your mansion? smiley-grin


Highly trained chimps?

Monkeys, workers.

Shouldn't have threw that joke to someone who might not get it, sorry :3
15  Using Arduino / Project Guidance / Re: Can not chat in two directions using Arduino Ethernet Shield, why? on: May 11, 2012, 03:44:23 am
I see, so you're aiming for some sort of system to send messages to highly trained chimps in your mansion? smiley-grin
Pages: [1] 2