Show Posts
Pages: [1] 2 3 ... 10
1  Development / Other Software Development / Re: OpenMoCo Menu Manager - completely automated menus for Arduino on: September 14, 2013, 02:41:51 am
Hey there,

the lib looks promising. I stumbled upon this when i was wading through the code for chronos, not liking it a bit. But what i liked about the chronos approach was the input of data through potentiometers. it is fast and with a small piezo as audio feedback even tactile. but how to incorporate this into the openmoco menu manager?

Thinking aloud here it could even be possible to use just one analog pin for the hole setup, attaching the pot to vcc and gnd via two resistors, so two extra buttons can short the analog pin to vcc or gnd as button values.

But i'm just a moderate c programmer, still not able to handle the abstract thoughtsbehind c++, so don't expect any code from me. :-(
2  Forum 2005-2010 (read only) / Forum / Re: Site perfromance seems to suck AGAIN! on: November 09, 2009, 04:08:17 pm
anyway, could we setup a form of load balancing or mirroring? or is that a BAD-IDEA. i was thinking about making a offline copy of the reference and playground pages with ICAB so i don't have to wait for every page.
3  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Interupts on: December 23, 2006, 07:25:09 pm
for what i've read, that is only for external interupts. but it is good that it will be part of the standard enviroment.
4  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Interrupts on: December 23, 2006, 06:08:30 pm
Actually, as a side effect of my plan to put the arduino in sleep, i have read a bit into interrupts to wake the thing up again. I haven't test it yet, but basically, you have to use the interrupt.h header file from Arduino-0006/tools/avr/avr/include/avr/ and copy it in a same named folder in the Arduino-0006/lib/targets/libraries/ folder.

Include it in your sketch like this:

Code:
#include interrupt.h

then you can turn interrups on with

Code:
sei();

and turn it off again with

Code:
cli();

don't leave it on forever, otherwise yor program will be interrupted on moments you dont want to.

then your interrupt routines will have a form of:
Code:
ISR(_interrupt_vecor_name_){

// code here

}

where _interrupt_vector_name_ is filled in with the apropiate interrupt you want.

these names are defined in the iom8.h file in two different forms. pick the one you like:

Code:
/* Interrupt vectors */

/* External Interrupt Request 0 */
#define INT0_vect                  _VECTOR(1)
#define SIG_INTERRUPT0                  _VECTOR(1)

/* External Interrupt Request 1 */
#define INT1_vect                  _VECTOR(2)
#define SIG_INTERRUPT1                  _VECTOR(2)

/* Timer/Counter2 Compare Match */
#define TIMER2_COMP_vect            _VECTOR(3)
#define SIG_OUTPUT_COMPARE2            _VECTOR(3)

/* Timer/Counter2 Overflow */
#define TIMER2_OVF_vect                  _VECTOR(4)
#define SIG_OVERFLOW2                  _VECTOR(4)

/* Timer/Counter1 Capture Event */
#define TIMER1_CAPT_vect            _VECTOR(5)
#define SIG_INPUT_CAPTURE1            _VECTOR(5)

/* Timer/Counter1 Compare Match A */
#define TIMER1_COMPA_vect            _VECTOR(6)
#define SIG_OUTPUT_COMPARE1A            _VECTOR(6)

/* Timer/Counter1 Compare Match B */
#define TIMER1_COMPB_vect            _VECTOR(7)
#define SIG_OUTPUT_COMPARE1B            _VECTOR(7)

/* Timer/Counter1 Overflow */
#define TIMER1_OVF_vect                  _VECTOR(8)
#define SIG_OVERFLOW1                  _VECTOR(8)

/* Timer/Counter0 Overflow */
#define TIMER0_OVF_vect                  _VECTOR(9)
#define SIG_OVERFLOW0                  _VECTOR(9)

/* Serial Transfer Complete */
#define SPI_STC_vect                  _VECTOR(10)
#define SIG_SPI                        _VECTOR(10)

/* USART, Rx Complete */
#define USART_RXC_vect                  _VECTOR(11)
#define SIG_UART_RECV                  _VECTOR(11)

/* USART Data Register Empty */
#define USART_UDRE_vect                  _VECTOR(12)
#define SIG_UART_DATA                  _VECTOR(12)

/* USART, Tx Complete */
#define USART_TXC_vect                  _VECTOR(13)
#define SIG_UART_TRANS                  _VECTOR(13)

/* ADC Conversion Complete */
#define ADC_vect                  _VECTOR(14)
#define SIG_ADC                        _VECTOR(14)

/* EEPROM Ready */
#define EE_RDY_vect                  _VECTOR(15)
#define SIG_EEPROM_READY            _VECTOR(15)

/* Analog Comparator */
#define ANA_COMP_vect                  _VECTOR(16)
#define SIG_COMPARATOR                  _VECTOR(16)

/* 2-wire Serial Interface */
#define TWI_vect                  _VECTOR(17)
#define SIG_2WIRE_SERIAL            _VECTOR(17)

/* Store Program Memory Ready */
#define SPM_RDY_vect                  _VECTOR(18)
#define SIG_SPM_READY                  _VECTOR(18)

INT0 and INT1 are external interrupts on the arduino pins 2 and 3 respectivily. they can be configured to react in different way's: trigger on rising or falling slope. LOW and change (like gonging from low to high or the other way round. these settings are controlled with a few bits in the MCUCR register:

two bits to set the interupt mode for each external interupt pin:

ISC01  ISC00 (int0)
ISC11  ISC10 (int1)    interupt if:
 0          0                low
 0          1                change
 1          0                falling slope
 1          1                rising slope

Code:

void setup() {

MCUCR |= (1<<ISC01);
MCUCR |= (0<<ISC00);  // should set a falling slope for int0 = arduino pin 2

...
}

this is done in the setup portion of your code.

comments appreciated.

Oh and btw, my sleep project is almost finished. you can follow it here:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1166480143
5  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: ET phone home? on: September 19, 2008, 03:10:39 pm
Aha,
little snitch showed it to me this evening. since i've installed it, I learn all sorts of things...
6  Forum 2005-2010 (read only) / Bugs & Suggestions / ET phone home? on: September 19, 2008, 02:02:19 pm
Why does the arduino ide want contact with arduino.berlios.de when i start it up?

ver. 11 on mac os x
7  Forum 2005-2010 (read only) / Bugs & Suggestions / corrections on reference docs on: May 05, 2008, 04:20:45 pm
I was reading the basics and spotted a error in the reference docs:

in the article about the unsigned int, the examples and syntax are missing the keyword UNSIGNED in front of them. small error, big confusion...
8  Forum 2005-2010 (read only) / Bugs & Suggestions / please remove delete function in IDE on: January 03, 2007, 03:55:08 pm
Hello there,

today i managed to erase my project by mistake by using the Delete menu item under the tab button. I'm running Mac OS X 10.3.9 and Arduino-0007.

My opinion is that it should not be possible for a application to directly delete anything on a users machine. better would be to place it in the trash/waste bin/recycler and let the user decide if he really wants to delete stuff.

The command line is the place to directly delete stuff, but in a GUI it's better to have a safetynet.
9  Forum 2005-2010 (read only) / Syntax & Programs / Re: Saving long numbers into eeprom on: December 04, 2009, 05:58:54 pm
gogging avr/eeprom.h i found a nice tutorial in pdf:
http://www.teslabs.com/openplayer/docs/docs/prognotes/EEPROM%20Tutorial.pdf
10  Forum 2005-2010 (read only) / Syntax & Programs / Re: Saving long numbers into eeprom on: December 04, 2009, 04:22:09 pm
yea. solved it that way. i only had to do a INT to two BYTE.

void readeventsCounter(){
  hiByte = EEPROM.read(0);
  loByte = EEPROM.read(1);
  eventsCounter = (hiByte << smiley-cool+loByte;
}

void writeeventsCounter(){
  loByte = byte(eventsCounter);
  hiByte = byte(eventsCounter >> smiley-cool;
  EEPROM.write(0, hiByte);
  EEPROM.write(1, loByte);
}


but i have'nt tested it yet. the reference is not clear about the functionality of the typecast to byte. i assume (i know, dangerous!) that it takes the lower byte of the int, but i have to find out in debugging.


got a nice quote from a friend of mine about c++:

"If C gives you enough rope to hang yourself, then C++ gives you enough rope to bind and gag your neighborhood, rig the sails on a small ship, and still have enough rope to hang yourself from the yardarm"

he is into cocoa now.
11  Forum 2005-2010 (read only) / Syntax & Programs / Re: Saving long numbers into eeprom on: December 04, 2009, 03:10:59 pm
another reason to start studying c++. this seems to be a good example. but for now i have to find another plain c way to write and read a int to eeprom.
12  Forum 2005-2010 (read only) / Syntax & Programs / Re: Saving long numbers into eeprom on: December 04, 2009, 02:37:04 pm
that is beyond me. it should obvious work, but because there are no comments in the code, i have no idea what is happening. i can code plain c, but this seems to be c++.

 smiley-sad pity.
13  Forum 2005-2010 (read only) / Syntax & Programs / Re: Typecasting or rounding off... on: December 06, 2009, 07:09:43 pm
well, i circumfenced the other problem and can confirm that casting down from float to int works for me. be shure you do it for the whole calculation, so all the other variables cast themselves as a float to before you round it off to a int
14  Forum 2005-2010 (read only) / Syntax & Programs / Re: Typecasting or rounding off... on: December 06, 2009, 04:45:04 pm
yeah, i know. the page is very brief to say the least. pages on the web deal mostly with upcasting (int>double) but not downcasting. i now use the trial-and-error methode to find out...

but there is another problem in my code that prevents me from finding out.
15  Forum 2005-2010 (read only) / Syntax & Programs / Typecasting or rounding off... on: December 06, 2009, 03:55:33 pm
hello all,

if i want to convert and round a float to a int, how would i do that?

int(floatVar)?

background:

i am calculating the sin(x) function to ramp up a stepper to full speed, but i use a for loop to do the actual clockpulses to the TA8439H stepper chip. so the result of the calculation should be a int.

Pages: [1] 2 3 ... 10