Show Posts
Pages: 1 ... 4 5 [6]
76  Using Arduino / Programming Questions / Re: Semaphores on: January 02, 2012, 04:08:35 am
I'm obviously missing something here :-), not first time.

So, how would I normally declare a bunch of semaphore ?
Can I use an unsigned int, ie 32bit, and declare semaphores from 0 to 31 using labels ?

I see its quite easy to set and clear them using bit() or bitset() etc

Cheers
77  Using Arduino / Programming Questions / Semaphores on: January 02, 2012, 03:23:21 am
I want to use 1 bit semaphores for communicating between tasks.
I have searched the site but everything points to semaphores using quite advanced RTOS, which I don't need.

Is there not some sort of framework for using semaphores in Arduino ?

I use Protothread as my cooperative "operating system"

K
78  Using Arduino / Programming Questions / Solved: Re: How to shuffle 8 inputs into a byte on: January 01, 2012, 07:29:25 pm
Primo. Thanks a lot as I hadn't seen those byte instructions.
K
79  Using Arduino / Programming Questions / Solved: How to shuffle 8 inputs into a byte on: January 01, 2012, 06:18:53 pm
I have been trawling the site, but to no avail. Maybe I'm searching the wrong thing.

Anyway, I want to take 8 inputs and put theses into a byte.
The inputs will be from different ports, so i cannot just read a port.

Input 1 to go into lsb or bit 0

I can do a digitalRead(pinX) but how do I get input information into a specific bit in the byte

Cheers and happy new year :-)

K
80  Using Arduino / Programming Questions / Re: Usimg millis() as a global timer on: December 27, 2011, 05:43:53 pm
I did search the site, but obviuosly not deep enough :-)

Found the answer here
http://www.arduino.cc/playground/Code/TimingRollover

Cheers
K
81  Using Arduino / Programming Questions / Usimg millis() as a global timer on: December 27, 2011, 02:45:24 pm
I want to use millis() as a global timer, however when it rolls over to zero, how do I handle that ?


Cheers
K
82  Using Arduino / Motors, Mechanics, and Power / Re: Hysteresis Current Control on: December 10, 2011, 01:31:02 am
Freescale, Texas and MicroChip, among others, have a significant amount of application notes on their web sites relating to vector drives and their applications.
Arduino should be fast enough for simple speed control and proof of design.

Once you go further you will need DSP/32bit to do real time calculations.
BTW you can get 32bit arduino (PIC32) boards :-)

K
83  Using Arduino / Programming Questions / Re: Simple Scheduler on: November 27, 2011, 03:37:43 am
Cool

Thanks

fiddler
84  Using Arduino / Programming Questions / Simple Scheduler on: November 26, 2011, 11:58:34 pm
I want to do a simple  scheduler like below.
I'm new to Arduino and C but done some assembly and Forth.

I have looked through the help files but haven't found anything yet.
I'm not ready for a fully blown RTOS yet, just something simple for now.

Any suggestions ?
fiddler
//+++++++++++++

void Main();
  GoTo  Task_1;
  GoTo  Task_2;
  GoTo  Task_3;
  GoTo  Main;
 
Task_1;
  return

Task_2;
  return

Task_3;
  return   
Pages: 1 ... 4 5 [6]