Loading...
  Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Programming Questions / Re: clock-driven round robin scheduler on: June 02, 2013, 03:25:57 am
I just want to make sure that no tasks take longer than a set time and that I get back to some tasks within a specified time.

If the task overrun in time, I just need to set a semaphore so I know. Possible do some controlled shutdown or something.

Would be handy to know which task overflows, but at this point is properly not necessary.

I don't need priority, dynamic scheduling or anything like that.

Round Robin schedulers are predictable.
Trying to eliminate use of interrupts to get predictability

Was sure this most have been done numerous times, but maybe not released as free/w

Have been watching the TTE systems videos on youtube and like his approach, predictability :-)



2  Using Arduino / Programming Questions / clock-driven round robin scheduler on: June 01, 2013, 02:21:21 pm
Hi

Im looking for a clock-driven round robin scheduler for the Arduino
Just need an task overrun indicator

I have had look but they all appear to be or close fully blown RTOS's

Any suggestions

Ta
3  Using Arduino / Programming Questions / Re: Eclipse linux Jantje's plugin on: May 30, 2013, 07:34:49 pm
Are you sure Eclipse is pointing to the right directory structure
There might be more than one place

I haven't got Eclipse at work so I cant check.

If blink works, try to include the wire.h and work from there
4  Products / Arduino Due / Re: SerialUSB instability - Program stalls on: March 30, 2013, 03:20:23 am
I think your timer may have a hickup when rolling over to zero.

micros() should use a "unsigned long" and not a "double"

K
5  Using Arduino / Programming Questions / Quadrature Encoder Library on: February 12, 2013, 01:50:29 am
Does anyone know of a library that can read a quadrature encoder and can calculate speed, acceleration, declaration, position etc
Searched the net by found nothing yet

Ta
6  Products / Arduino Due / Re: Downloading to due from Ubunti 12.10 with arduino ide on: January 20, 2013, 07:22:36 pm
I ran Ubuntu fine, but is now running Mint (a Ubuntu derivative).
There is/was an issue occasionally with the USB drivers under Linux.
You may want to search for this in the Ubuntu forum.

Does the standard Arduino IDE run and download fine ?
7  Using Arduino / Networking, Protocols, and Devices / Re: Serial.write error when sending an array on: January 15, 2013, 03:24:58 am
Cheers for that.
Coming from a 8bit assembly world, C can be a bit hard to to interpret at time
int used to be a byte for me

getting there
:-)
8  Using Arduino / Networking, Protocols, and Devices / Serial.write error when sending an array on: January 15, 2013, 02:57:53 am
the following code has a compiler error, which I don't quite understand

Code:
int serialArrayOne[]  = {1,2,3,4,5,6,7,8};

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.write(serialArrayOne,8);
}


error is:
sketch_jan15a.cpp: In function ‘void loop()’:
sketch_jan15a.cpp:19:32: error: no matching function for call to ‘HardwareSerial::write(int [8], int)’
/usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:58:20: note: candidates are: virtual size_t HardwareSerial::write(uint8_t)
/usr/share/arduino/hardware/arduino/cores/arduino/Print.h:50:20: note:                 virtual size_t Print::write(const uint8_t*, size_t)
/usr/share/arduino/hardware/arduino/cores/arduino/Print.h:49:12: note:                 size_t Print::write(const char*)

The manual says
Serial.write(buf, len)
buf: an array to send as a series of bytes
len: the length of the buffer

Anyone care to enlighten me

Cheers
Kim
9  Using Arduino / Networking, Protocols, and Devices / Sorted - Re: RS485 issue using SoftwareSerial() on: January 14, 2013, 07:38:23 pm
Sorted.

For some reason I commented out 
//#include <RS485_protocol.h>
and included
#include <RS485_non_blocking.h>

when both should be included.
Sometimes you just can't see the forest for the trees

Cheers
10  Using Arduino / Networking, Protocols, and Devices / Re: RS485 issue using SoftwareSerial() on: January 14, 2013, 01:27:36 pm
Straight from Nick Gammon site
http://www.gammon.com.au/forum/?id=11428
11  Using Arduino / Networking, Protocols, and Devices / RS485 issue using SoftwareSerial() on: January 14, 2013, 01:02:48 am
Hi

I have downloaded Nick Gammon code, but are having some compiling issues.
I got it down to 2 errors

Code:
//#include "WConstants.h"
#include <RS485_non_blocking.h>
//#include "RS485_protocol.h"
#include <SoftwareSerial.h>

const byte ENABLE_PIN = 4;
const byte LED_PIN = 13;

SoftwareSerial rs485(2, 3);  // receive pin, transmit pin

// callback routines
 
void fWrite (const byte what)
  {
  rs485.print (what); 
  }
 
int fAvailable ()
  {
  return rs485.available (); 
  }

int fRead ()
  {
  return rs485.read (); 
  }

void setup()
{
  rs485.begin (28800);
  pinMode (ENABLE_PIN, OUTPUT);  // driver output enable
  pinMode (LED_PIN, OUTPUT);  // built-in LED
}  // end of setup
 
byte old_level = 0;

void loop()
{

  // read potentiometer
  byte level = analogRead (0) / 4;
 
  // no change? forget it
  if (level == old_level)
    return;
     
  // assemble message
  byte msg [] = {
     1,    // device 1
     2,    // turn light on
     level // to what level
  };

  // send to slave 
  digitalWrite (ENABLE_PIN, HIGH);  // enable sending
  sendMsg (fWrite, msg, sizeof msg);
  digitalWrite (ENABLE_PIN, LOW);  // disable sending

  // receive response 
  byte buf [10];
  byte received = recvMsg (fAvailable, fRead, buf, sizeof buf);
 
  digitalWrite (LED_PIN, received == 0);  // turn on LED if error   
 
  // only send once per successful change
  if (received)
    old_level = level;

}  // end of loop

Errors are:
sketch_jan14a.cpp: In function ‘void loop()’:
sketch_jan14a.cpp:62:35: error: ‘sendMsg’ was not declared in this scope
sketch_jan14a.cpp:67:62: error: ‘recvMsg’ was not declared in this scope

But what do I replace the sendMsg with.
I have looked through the SoftwareSerial.cpp and .h files but nothing springs to mind

Thanks for any suggestions

Kim
12  Products / Arduino Due / Re: Using the Hardware Quadrature Encoder Channel on the DUE on: January 10, 2013, 01:58:00 pm
dreschel

Did you get the encoder to work ?
It appear that only 1 of the the 2 Quadrature channels pins have been connected to pins.
13  Products / Arduino Due / Re: Arduino Due - Accessing registers and inline assembly on: January 03, 2013, 04:46:47 am
I suggest using something like Ken Smith's paper is describing:

"C++ Hardware Register Access Redux"

Its a policy based design using function templates and once setup has clarity and safety.

14  Using Arduino / Programming Questions / Re: trouble with simple IF...ELSE on: December 22, 2012, 03:08:11 pm
Sweet.
Thanks for that
15  Using Arduino / Programming Questions / trouble with simple IF...ELSE on: December 22, 2012, 03:01:41 pm
I can't for the life of me work out why the code below doesn't work.
Never gets to the ELSE statement, something keeps changing the "pinstate" back to zero

Cheers
K

Code:
void BlinkLED13()
{
  // blinks LED 13
  int pinstate;      // state of the output pin

  if (pinstate == 0)
  {
    digitalWrite(ledPin, pinstate);
    pinstate = 1; 
    delay(100);
  }
  else
  {
    digitalWrite(ledPin, pinstate);
    pinstate = 0;
    delay(100);
  }

}
Pages: [1] 2 3 ... 6