Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 70
61  Products / Arduino Yún / Re: Timer 1 Yun Process not working! on: January 25, 2014, 10:09:57 am
It seems to me you are over complicating things.
You could put the call to your function in the loop, and drop the timer1 library

Code:
void loop() {
 LightSensor();
delay(5000);
}

And for debug you could use the serial monitor

Code:
while (p.available() > 0) {
    result = p.read();
    Serial.println(result);
  }
62  Products / Arduino Yún / Re: Timer 1 Yun Process not working! on: January 24, 2014, 04:59:26 am
The timer1 library dosn't work on the Yun/leonardo

You could try this solution:

http://www.suspectdevices.com/blahg/arduino/using-the-timer1-and-timer3-libraries-with-the-arduino-leonardo/
63  Using Arduino / Programming Questions / Re: Change analogWrite() frequency on: January 23, 2014, 04:18:59 pm
The other pwm pins on the Leonardo are the usual 490 HZ
64  International / Scandinavia / Re: Irremote problem on: January 23, 2014, 12:12:16 pm
@kamokaki

Det er ikke populært at stille samme spørgsmål i flere sub-fora

http://forum.arduino.cc/index.php?topic=212568.msg1557980#msg1557980
65  Using Arduino / Microcontrollers / Re: Standalone 3.3v Atmega 328p - Do I need a Crystal or Resonator? on: January 22, 2014, 05:36:35 pm
I noted that you power the mini with 3.3V.
That is not a good idea as the programming lines are at 5V, so you are risking to destroy the mini.
 The max. voltage supplied to the pins is VCC+0.5V = 3.8V.
It is better to poer the mini with 5V
66  Products / Arduino Yún / Re: From Linino small C++ Daemon talking to Microsoft SQL Server/Web Server on: January 22, 2014, 09:33:49 am
I don't know if it is the best way, but using curl is simple

Code:
curl http://ernstc.dk/yun_db.php

This will retriev one row from a database hosted on a webserver somewhere in the world.

It is a mySql database, but that could be any database
67  Using Arduino / General Electronics / Re: Powering Attiny on: January 22, 2014, 08:22:50 am
You say it keeps restarting, which propably meens that it is resetting.

Put a 10 KOhm resistor from reset to 5V, and a 0.1 uF capacitor from 5V to ground as close to the tiny as possible.
68  Products / Arduino Yún / Re: Change pwm frequency on: January 20, 2014, 06:20:14 am
Millis use timer 0, so this will not effect the millis()


Code:
TCCR1B = _BV(CS40); //pin 9 & 10 31.250 KHZ
69  Using Arduino / Project Guidance / Re: ATtiny85, delay() and TIMER0_COMPA_vect on: January 20, 2014, 06:15:56 am
That was not a good example, sorry.
The below example works, it seems that the order of the commands are important.

Code:
const byte led4 = 4;
const byte led3 = 3;

volatile int count = 0;

void setup(){
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  cli();
  TCCR0A = 0;
  TCCR0B = 0;

  TCCR0A |=(1<<WGM01); //Start timer 1 in CTC mode Table 11.5
  TIMSK |= (1 << OCIE0A); //Enable CTC interrupt see 13.3.6
  OCR0A=127; //CTC Compare value
  TCCR0B |= (1 << CS02) | (1 << CS00); // Prescaler =1024 Table 11.6
  sei();
}

ISR(TIMER0_COMPA_vect)
{
  count++;
  if (count>30){
    digitalWrite(led4, ! digitalRead(led4));
    count=0; 
  }

}

void loop(){
  digitalWrite(led3,HIGH);
  delay(1000);
  digitalWrite(led3,LOW);
  delay(1000);
}
70  Using Arduino / Project Guidance / Re: ATtiny85, delay() and TIMER0_COMPA_vect on: January 19, 2014, 09:29:04 am
This should work, the only differense is this line:

Code:
TCCR0A |=(1<<COM0A1); //Timer0 in toggle mode Table 11.2


Code:
const byte led4 = 4;
const byte led3 = 3;

volatile int count = 0;

void setup(){
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  cli();
  TCCR0A = 0;
  TCCR0B = 0;

  TCCR0A |=(1<<WGM01); //Start timer 1 in CTC mode Table 11.5
  TCCR0B |= (1 << CS02) | (1 << CS00); // Prescaler =1024 Table 11.6
  OCR0A=127; //CTC Compare value
  TCCR0A |=(1<<COM0A1); //Timer0 in toggle mode Table 11.2
  TIMSK |= (1 << OCIE0A);
  sei();
}

ISR(TIMER0_COMPA_vect)
{
  count++;
  if (count>30){
    digitalWrite(led4, ! digitalRead(led4));
    count=0; 
  }

}

void loop(){
  digitalWrite(led3,HIGH);
  delay(1000);
  digitalWrite(led3,LOW);
  delay(1000);
}

71  Using Arduino / Microcontrollers / Re: Problem reading flash avrdude on: January 14, 2014, 08:42:43 am
Dont use Apostrophes and use :i (Intel HEX format)


Code:
-Uflash:w:Blink.cpp.hex:i
72  Products / Arduino Yún / Re: Anyone been able to get SoftwareSerial or Alt Serial to work on Yun? on: January 13, 2014, 10:18:44 am
Quote
Does the Arduino output standard RS-232 levels?

No that would mean -13 to +13V, so if that is what you are using, it will damage your Yun.
Arduino use TTL level (0.5V).
One more thing standard RS-232  are inverted, which could explain why see garbled text.
https://www.sparkfun.com/tutorials/215

I use one of these cheap USB/Serial converters.

http://www.ebay.com/itm/New-Upgrade-PL2303HX-USB-Serial-To-RS232-TTL-Chip-Auto-Converter-Adapter-Module-/290984791202?pt=UK_Computing_CablesConnectors_RL&hash=item43c00b8ca2

If you have an Arduino Uno you could use that instead
73  Products / Arduino Yún / Re: Anyone been able to get SoftwareSerial or Alt Serial to work on Yun? on: January 12, 2014, 06:56:25 am
I just did a test, I must admit I haven't tried using softwareserial on the Yun, but it worked as expected, no problems.

my test sketch below.
I used a USB/serial converter connected to pin 9 on the Yun

Code:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(8, 9);
int x = 0;

void setup()
{
  mySerial.begin(9600);
  mySerial.println("Hello, world?");
}

void loop() // run over and over
{

  mySerial.print("Loop");
  mySerial.println(x);
  x++;
  delay(1000);
}
74  Using Arduino / Microcontrollers / Re: Arduino as ISP on: January 12, 2014, 06:35:54 am
Quote
The problem is that my UNO gets programmed with the same code i try to upload to the Atmega8.

You have to disable autoreset. Connect a 10uF capacitor from reset to ground on your Uno.

And use upload using programmer, instead of upload
75  Products / Arduino Yún / Re: Checking battery status on: January 11, 2014, 11:50:09 am
You could use a voltage divider to bring the voltage from your battery under 5v, and read it eith analogRead()
Pages: 1 ... 3 4 [5] 6 7 ... 70