Pages: 1 ... 7 8 [9] 10
 81 
 on: Today at 06:22:53 pm 
Started by MauroTec - Last post by MauroTec
Io non ho esperienza pratica con RTOS, solo teoria. Con esperienza pratica significa che non ne ho mai scelto uno e quindi mi sono limitato a giocare con gli esempio di.. ad esempio ho bertos o qualcosa di simile.

Questo rtems sembra roba proprio tosta e ad alto livello. La rogna è che la toolchain che ho installata nel sistema non va bene, ne devo compilare una specifica per rtems. Ci sono anche dei pacchetti rpm, deb ecc pronti ma purtroppo non ho trovato nulla di pronto per Fedora 17, quindi mi tocca tentare il build manuale, ma aspetterò ancora un paio di giorni per saperne di più.

ChibiOS, mi pare che sia basata su un cooperative task, cioè niente switch context.
Ah dimenticavo per rtems, leggendo veloce mi pare di aver letto che come opzione c'è lo scheduler deadline, si c'è almeno nella doc http://rtems.org/onlinedocs/doc-current/share/rtems/html/c_user/Scheduling-Concepts-Earliest-Deadline-First-Scheduler.html#Scheduling-Concepts-Earliest-Deadline-First-Scheduler

Ciao.

 82 
 on: Today at 06:20:41 pm 
Started by Jonny92 - Last post by PaulS
Quote
Is there a way to tell time.h to work with timer1?
No, because time.h doesn't do anything directly with timers. It relies on millis() operating correctly.

 83 
 on: Today at 06:20:37 pm 
Started by Wiskey - Last post by Wiskey
Quite good in fact.  I have a connector soldered to a shield which plugs into the Arduino.  A 5 foot wire plugs into that connector, and this goes out to a plug which connects to the screen.  The screen is mounted, and the arduino is inside a plastic project case, the wireing is behind an aquarium stand so it is not touched.

Whiskey

 84 
 on: Today at 06:20:08 pm 
Started by smithy - Last post by raschemmel
You can call it a port expander if you want but everyone else calls it a backpack. We all know what it does and how it works. The point is in all of your posts you talk about connecting this or that and never mention what I/O lines anything is connected to.
.The Port Expander you are using has an lcd plugged into it. If you are using expander ports that are not used by the lcd that's a different matter. From your post it is not clear which pins you are talking about. I am not going to spend any more time on this until you post a complete schematic of your protoboard and everything connected to it. If you think you can fix a hardware problem by talking about software then good luck to you. I never said you couldn't use other expander lines . I said as far as controlling the lcd, if all the lcd parallel control lines are plugged into the backpack (port expander) than ALL lcd control is under I2C, including the backlight. That's how my I2C lcd works. That means the lcd control lines you mentioned before (RS, EN, DB4-7 ) are controlled by the port expander through I2C. What you do with the other unused port expander lines is another matter. (which we never talked about). I still don't where your buttons are connected or which signal lines they are connected to.  My point is I am not going to troubleshoot a hardware issue without a schematic. Post a complete schematic or fix it yourself.
Quote
I am using a self made lipo battery pack 12S 10AH resulting in 50.05V
And you your onboard 5V regulator is running on an input of 50V ?

FYI,
If it is a software issue I probably would not be able to help you because I have never used Tinywire. I write analog values to my I2C lcd using LiquidCrystal library. If I were using a PCF8574 chip on a breadboard I would use TWI library and something like this:
Code:
 
Wire.beginTransmission(redchip);
 Wire.write(B00000000);
delay(500)
 Wire.write(B11111111);
delay(500)
 Wire.endTransmission();
ALSO,
THIS:
Quote
When i press a button i can see my Battery voltage increasing alot and i quite don´t know where to dig.

Can you explain HOW your battery voltage can INCREASE when you press a button ?
I could understand if it said "decreasing" (as in you're loading down the battery , but "increasing ?
It doesn't make sense. Your battery is getting energy from somewhere or what ? I have never seen that happen in 30 years in
electronics (unless you had a charger plugged in). That's a mystery.
ONE MORE THING:
As I said, I probably can't help you with the software, but FYI, if you can't take the time to put comments in your code ,the chance that anyone on the forum is going to bother trying to figure out what it does is probably rather slim.
In short , it comes down to this:
SCENARIO A: Problem is software bug
Put comments in your code and maybe someone will look at it.
SCENARIO B: Problem is hardware related:
Post a schematic drawn by hand with pen and paper and photographed with a cell phone of your complete circuit.

 85 
 on: Today at 06:20:06 pm 
Started by defcon618 - Last post by jremington
A typical 12V Peltier module takes 5-7 amperes of current. No wonder the converter is getting hot!

 86 
 on: Today at 06:19:43 pm 
Started by Gerry48 - Last post by retrolefty
In the directory that stores all you own sketches there is a directory named libraries. Inside the libraries folder there are folders for each of the contributed libraries you have installed over time. Simply delete the folder named SD and it should not longer show up in the IDE's library choices. You have to close then reopen the IDE before it sees the change.


 87 
 on: Today at 06:19:36 pm 
Started by printerbird - Last post by printerbird
Hello! I was using the GWS S35 STD continuous rotation motor but eventually it wore itself out with the load that I had. I swapped it for a Parallax motor and it runs great - the only problem is that the new motor doesn't respond to my code - it just runs continuously instead of the start/stop/pause that I have in my code . So now I'm at a loss about what do to get it to pay attention to the code. I'm assuming I need to change something in my language (i.e. the parallax requires a different language than the S35)? The serial monitor shows that the code is doing what its supposed to (i.e. no weird values) but the motor doesn't respond to any of the commands. I am fairly new to this game and my troubleshooting skills are fairly limited. Any help is welcome! Thank-you! smiley

I've included my code which works great with the old motor (no problems). Note: the code for the light gets written out with the bool declaration at the start. 
Code:
#include "Servo.h"

// if you are putting this code in the light piece, set to true
// if you are putting this code in the motor piece, set to false
bool lightPiece = false;


// 20 and 80 for motor
// 10 and 25 for light
int trigger = 35; // This is how close someone needs to be to set off
int resetTrigger = 80; // This is arbitrary and only matters for resetting after someone has
// triggered maxRepeat times
//  could be anything above trigger

// variables declared here will be global and accesible by all loops(scopes) from here down
// I always set loop or sensor variables to zero unless antother default is needed, why?
// Because it ensures that they are set to something initially and not some random value
// in memory.
// Motor code
Servo exMotor;
const int motorPin    = 9;  // motor on pin 9
const int PWPinMotor  = 5;  // sensor on analog 5
const int motorStop   = 90; // may need some adjusting to find stop-point.
const int motorFwd    = 45; // or 135 for the opposite direction

// LED code
const int LED = 9; //LED on pin 9
const int PWPinLED = A0; // sensor on analog 0

// code for logic
int i=0;
int samples = 0;
int sdist = 0;      // sensor distance, raw value returned fron the sensor
int nsamp = 20;   // number of samples to read an average
int pause = 3000;  // pause for 3 seconds before reading any more values, should delay constant going off if standing in front of sensor
bool empty = true;

// Constants
int maxRepeat = 5; // The maximum number of times you want to set off before shutting down
int nRepeat = 0; // A counter for how many times it has been set off

void setup()
{
  if (lightPiece)
  {
    setupLight();
  }
  else
  {
    setupMotor();
  }
  delay(3000);
  // gives you 3 seconds to get your posterior out of the way of the sensor before I calibrate
  // default readings are hard coded

}

/////////////////////////////
// Setup the motor
////////////////////////////
void setupMotor()
{
  exMotor.write (motorStop);
  exMotor.attach (motorPin);
  Serial.begin(9600);
  Serial.println("Arduino Duemilanove ATmega328 Starting");
}

/////////////////////////////
// Setup the light
///////////////////////////
void setupLight()
{
  pinMode(LED, OUTPUT);
  Serial.begin(9600);
  Serial.println("Arduino Duemilanove ATmega328 Starting");
}


void loop()
{
  samples=0;
  // read nsamp number of samples from the sensor and average them when done
  // this will avoid being set off by a couple bad values
  int totalSamplesTaken = 0;
  for (i=0; i<nsamp; i++)
  {
    if (lightPiece)
    {
      sdist = analogRead(PWPinLED);
    }
    else
    {
      sdist = analogRead(PWPinMotor);
    }
    samples+=sdist;
  }
  sdist = samples/nsamp;


  Serial.println();
  Serial.print("Sensor Distance sampled (sdist) ");
  Serial.println(sdist, DEC);


  // if the room is empty, and there is someone close enough to trigger
  //  but only trigger five times in a row
  if (empty)
  {
    if(sdist < trigger)
    {
      Serial.print("Triggered: ");
      Serial.println(sdist);
      if (nRepeat < maxRepeat)   // run it five times 
      {
        // Run the motor or turn on the light
        if (lightPiece)
        {
          changeLight(true);
        }
        else
        {
          changeMotor(true);
        }
        nRepeat++;
        Serial.print("Repeat: ");
        Serial.println(nRepeat);
      }
      else // we have reached our maximum repeat, turn it all off
      //  until someone moves farther away
      {
        if (lightPiece)
        {
          changeLight(false);
        }
        else
        {
          changeMotor(false);
        }
        Serial.println("Max repeats reached");
        Serial.println("OFF"); 
        empty = false;
      }
    }
    else // there was no trigger, so reset our maximum count
    {
      nRepeat = 0;
    }
  }

  // if the room is full, test to see if the person has moved away
  if (!empty)
  {
    Serial.println("Full");
    if (sdist > resetTrigger)
    {
      empty = true;
      nRepeat = 0;
    }
  }
  delay(1000);  //checks sensor every 1 second for person/object 
}

/////////////////////////////
// This will turn the light
// on and off depending on
// true false passed in
////////////////////////////
void changeLight(bool change)
{
  if (change)
    {
    Serial.println("ON");
    digitalWrite(LED, HIGH);
    delay(2000);
    digitalWrite (LED, LOW);
    }
  else
  {
    Serial.println("OFF");       
    digitalWrite(LED, LOW);
  }
}


/////////////////////////////
// This will turn the motor
// on and off dependon on
// true false passed in
////////////////////////////
void changeMotor(bool change)
{
  if (change)
  {
    Serial.println("ON");
    exMotor.attach (motorPin);
    exMotor.write (motorFwd);   
    delay(2000);
    exMotor.write (motorStop);
  }
  else
  {
    exMotor.detach();
  }
}



 88 
 on: Today at 06:18:36 pm 
Started by troyka_4484 - Last post by PaulS
You could also have swapped the wires.

 89 
 on: Today at 06:17:30 pm 
Started by Wiskey - Last post by Peter_n
How is your wiring between the Arduino and the display ?

 90 
 on: Today at 06:17:16 pm 
Started by Rickmc3280 - Last post by PaulS
Quote
but most of seems to assume an intermediate level of programming knowledge.
That's because string parsing IS an intermediate topic, not a beginning topic. However, if you send "D,123", it is far easier to parse that "D123". Look at strtok() and atoi().

Pages: 1 ... 7 8 [9] 10