Show Posts
Pages: 1 ... 10 11 [12] 13 14 ... 36
166  Community / Bar Sport / Re: PaulS - 40,000 posts! on: October 18, 2013, 11:33:54 am
Given that this theme (50K Member level) has been touched, I'd honor a living Italian genius of our time: Federico Faggin. Regards!
167  Community / Bar Sport / Re: PaulS - 40,000 posts! on: October 17, 2013, 09:25:04 pm
168  International / Español / Re: servo on: October 17, 2013, 04:57:15 pm
¡Hola taper!
Me alegra poderte haber sido de ayuda. También me alegra saber que contamos en el foro con un modelista ferroviario como tú. Siempre me han fascinado los modelos de trenes. Si tienes alguna página o link en Internet, sería bueno si nos lo haces saber, a fin de tener una mejor idea del tamaño y tipo de los modelos con que trabajas.

Siempre a tus órdenes. Pero como bien dice Cheyenne, la idea es servirte de guía en esta senda de implementación de ideas usando Arduino,  pues al final los primeros pasos los debes dar tú.

Anexo la forma de agregar documentos (archivos, fotos, videos, etc.)



 Saludos cordiales.
169  International / Español / Re: servo on: October 17, 2013, 02:08:07 pm
Hola taper,
Hice algunos cambios y adiciones a tu codigo. Te anexo el codigo (corre bien). Tambien te anexo un diagrama de conexiones del Arduino con el servo y el boton. Por favor avisame si te sirve. Saludos cordiales.

Code:
#include <Servo.h>

Servo myservo;

const int SERVO = 9;
const int BUTTON = 7;

int val = 0;
int old_val = 0;
int estate = 0;
int pos = 0;

void setup(){
  myservo.attach(SERVO);
  pinMode(BUTTON,INPUT);
  myservo.write(45);
}

void loop()
{
  val = digitalRead(BUTTON);                       
  if ((val == HIGH) && old_val)
  {
    if (estate)     
    {
      estate = 0;
      for(pos = 0; pos < 45; pos += 1) 
      {                                   
        myservo.write(pos);             
        delay(20);                       
      }     
    }
    else
    {
      estate = 1;   
      for(pos = 45; pos>=1; pos-=1)     
      {                               
        myservo.write(pos);             
        delay(20);                     
      }   
    }
    old_val = 0; 
  }
  if (val == LOW)
  {
    old_val = 1;             
  }
}

170  Community / Bar Sport / Arduino Due and the Nostromo's computer on: October 16, 2013, 12:02:18 pm
Occasionally, I remember the opening scene of Ridley Scott's sci-fi film “Alien” (1979) where MU/TH/UR 6000 - the USCSS Nostromo's computer mainframe - awakens the crew after detecting a transmission of unknown origin. Remember? The ship's hallways, all long, dark and empty; all the instrumentation at rest...and suddenly...electrical hum, red and yellow lights go on reflected in two helmets resting on chairs, electronic pulsing sounds,...

From the above, we can infer that the acoustical beacon: that distress call transmitted from the wrecked alien spacecraft in a nearby planetoid, had previously also awakened "Mother", in a way.

The other night, reading about the ARM Cortex-M3 revision 2, I found out that a new ultra-low-power feature called Wake up Interrupt Controller (WIC) was added. The WIC is an optional implementation that allows the system to wake up from interrupt events while the processor (including the NVIC) is completely stopped or powered down (in stasis like the crew). The WIC is not programmable, and does not have any registers or user interface. It operates entirely from hardware signals. Any clock signal going into the processor core can be completely stopped. The WIC only leaves a small portion of the logic gates to retain the current state of the processor saved in special logic cells. When an interrupt arrives, the WIC sends a request to the Power Management Unit (PMU) to power up the system. All of this for the sake of reducing power consumption. Sadly, this feature was never implemented in the SAM3 or SAM4 series. Why? Because of very limited interest. However, the SAM3X8E features several low power modes (Sleep, Wait and Backup) and wake-up capabilities which allow reducing consumption to a minimum (2.5uA typ) and waking up fast (< 0.5 ms) using WFE or WFI instructions by setting the SLEEPDEEP bit in the System Control Register (SCR).

All of this, in combination with the Arduino Starter Kit project #2: a spaceship interface, (http://arduino.cc/en/ArduinoStarterKit/Prj02) make me think to port to Arduino Due, one of these days, the Atmel ASF Low Power example that shows how to invoke the low power modes using the WFE and WFI instructions and adding three LEDs as status indicators and two buttons (for a simulated Nostromo spaceship) to send to deep sleep or wake up the Arduino Due (like an also Mother or simulated crew). I will leave you the Alien simulation. Regards!
171  Development / Suggestions for the Arduino Project / Re: intel Galileo and SD problems on: October 14, 2013, 10:43:39 pm
Hello Giangegnere,
I don't see yet here in the forum a dedicated topic for the new Intel Galileo motherboard in the Products board. Thus, I would recommend you to post this same question about your issue with SD datalog of ADC values to the Intel support community.
https://communities.intel.com/community/makers

There are lots of Intel Makers and external Makers (Arduino/Atmel) keeping an eye on the Galileo support forum, and you might find answers quicker there than waiting here. Just a thought. Regards!
172  Products / Arduino Due / Re: Due appears as COM6 port but gives error "No device found on COM6" on upload on: October 14, 2013, 09:06:38 am
Aren't the input capacitors on the original Italian Arduino Due rated for 16V? Then why 25V? Is Arduino producing boards with 25v? My Due board (D00000721) has only the 16V ones. Regards!
173  Products / Arduino Due / Re: Possibly faulty bootloader of a new Arduino Due on: October 14, 2013, 08:44:16 am
Hello raikovm,
I am curious about which Due's USB port you are using. Is it the native or the programming port (the one closest to the DC power jack)? I also would like to know the brand/seller of your Due. Is it the original Italian board? It is not strange to see third-party Due based boards with different 'eagles' from the original Italian one. Regards!
174  International / Español / Re: Problemas con lcd valore extraños on: October 13, 2013, 06:16:13 pm
Hola Alex,
Lo poco que puedo deducir de tu codigo y video es que tienes un conflicto entre tu pantalla y los pines 3 (bombilla) y 4 (filtro). Algunos controladores de pantallas usan esos pines con el 4to. bit superior ( de lenguaje Japones o Europeo). Seria bueno que intentaras correr tu codigo asignando otros pines para bombilla y filtro. Es solo una idea pues hace tiempo que no programo LCDs. Saludos!   
175  Products / Arduino Due / Re: Building a CAN API for Arduino DUE on: October 10, 2013, 04:57:03 pm
I am not sure if the Time Trigger Mode mentioned in the Atmel doc11057 is related to the FTTC (Flexible Time-Triggered communication) high level layer extension to the CAN protocol (also known as TTCAN) specified in the ISO 11898-4 in 2004 for ECU devices. If so, I haven't implemented so far a test code solution, although it would be a good question for the Atmel AT91SAM support.
176  Products / Arduino Due / Re: Building a CAN API for Arduino DUE on: October 10, 2013, 09:04:35 am
Just one more thing, as you have mentioned that the Can structure is from the file " component_can.h ", how/where do link this to our "due_can.h" so that the compiler knows where to look for Can structure?

Hello Owais,
I don't know which version of the IDE 1.5.x you are using but if you do a simple excercise of changing the name of the component_can.h file located at
 
Quote
...\arduino-1.5.x-windows\arduino-1.5.x\hardware\arduino\sam\system\CMSIS\Device\ATMEL\sam3xa\include\component

Let's say i.e. renaming as componen_can1.h, you will find the debugging chain showing the error. Here the simplify chain:

Quote
due_can.h->sn65hvd234.h->variant.h->Arduino.h->chip.h->sam.h->sam3.h->sam3xa.h->sam3x8e.h->component_can.h

Notice that it starts with due_can.h and then through the transceiver driver points to the variant file and so on until reach the component_can.h file that contains the Can structure.

Regards!
177  Products / Arduino Due / Re: Building a CAN API for Arduino DUE on: October 09, 2013, 01:37:46 pm
Hello,
           I am in the process of understanding the CAN library created for DUE. I am having trouble in figuring out this exact declaration :
Can*  m_pCan;

           I have seen the typ def Can in the beginning of " due_can.h " but it is only as a reference as to how the struct is defined besides that there is no other definition available of this type. Can someone please clear this up for me.

Regards.

Hello Owais,

Can* m_pCan is a parameter of a Can function. More specifically, a defined address.
For the two Can controllers inside Arduino Due's SAM3X8E, the current CAN library (originally ported from Atmel) has defined two CAN addresses: CAN0 (0x400B4000U) and CAN1 (0x400B8000U). See sam3x8e.h file at

Quote
...\arduino-1.5.2-windows\arduino-1.5.2\hardware\arduino\sam\system\CMSIS\Device\ATMEL\sam3xa\include

Let's dissect a bit the Can* m_pCan parameter:

Can: is a structure that contains the Can hardware registers, and it is part of the component_can.h file

Quote
...\arduino-1.5.2-windows\arduino-1.5.2\hardware\arduino\sam\system\CMSIS\Device\ATMEL\sam3xa\include\component

m_pCan: is the Pointer to a CAN peripheral instance.

When we declare Can*  m_pCan, m_pCan is a variable that stores the address of a variable of the structure Can.
If for example, we want to enable the CAN controller 0. Then in the main, the function call looks like:

Quote
CAN.enable();

And that's it! but... to get a better understanding (as you requested) of the parameter, let's take a look at the original function (before the CANRaw class was created).

The call of the old function looks like:
  
Quote
can_enable(CAN0);

And the old function itself:

Code:
void can_enable(Can*  m_pCan)
{
m_pCan->CAN_MR |= CAN_MR_CANEN;
}

Where...

CAN_MR_CANEN is the CAN controller enable register. Bit 0 (0x1u << 0)
CAN_MR is the CAN mode hardware register inside the Can structure.

Thus, when we type can_enable(CAN0); we are declaring the call of the can enable function that points to the CAN controller 0 that SET the bit 0 of the enable register in the can mode hardware register inside the can structure.

Notice that all of this is transparent for the user given that all the Can functions are handle for the CANRaw class.

I hope this helps. Regards!
178  Community / Website and Forum / Current "Most Online" number somewhat excessive on: October 03, 2013, 11:36:42 am
Hello. I just noticed that forum's current 'Most Online' is 2743 for October 2013. I am not sure but it looks like a bit big if compared with the last one (1131-Sept.2013). May be the ongoing Rome Faire or the last maintenance has to do with it. Regards!   

http://forum.arduino.cc/index.php?action=stats
179  Using Arduino / Interfacing w/ Software on the Computer / Re: 9DOF + Arduino + Processing on: September 30, 2013, 03:50:06 pm
Hello bakkard90,
Here an example that does what you want but for Arduino Uno + 3DOF gyro L3G4200D. I believe, it is about to tweak it a little bit (replace with your sensor library, replace with your COM port, etc..).

The Arduino Uno code:
Code:
#include <Wire.h>
#include <L3G4200D.h>
L3G4200D gyro;
int sampleNum=500;
int dc_offset_x=0;
int dc_offset_y=0;
int dc_offset_z=0;
double noise=0;
unsigned long time;
int sampleTime=10;
int rate_x;
int rate_y;
int rate_z;
int prev_rate_x=0;
int prev_rate_y=0;
int prev_rate_z=0;
double x=0;
double y=0;
double z=0;
void setup() {
Serial.begin(9600);
Wire.begin();
gyro.enableDefault();
//Calculate initial DC offset and noise level of gyro
for(int n=0;n<sampleNum;n++){
gyro.read();
dc_offset_x+=(int)gyro.g.x;
dc_offset_y+=(int)gyro.g.y;
dc_offset_z+=(int)gyro.g.z;
}
dc_offset_x=dc_offset_x/sampleNum;
dc_offset_y=dc_offset_y/sampleNum;
dc_offset_z=dc_offset_z/sampleNum;
for(int n=0;n<sampleNum;n++){
gyro.read();
if((int)gyro.g.z-dc_offset_z>noise)
noise=(int)gyro.g.z-dc_offset_z;
else if((int)gyro.g.z-dc_offset_z<-noise)
noise=-(int)gyro.g.z-dc_offset_z;
}
noise=noise/100; //gyro returns hundredths of degrees/sec
delay(4000);
}
void loop() {
if(millis() - time > sampleTime)
{
time = millis(); // update the time to get the next sample
gyro.read();
rate_x=((int)gyro.g.x-dc_offset_x)/100;
rate_y=((int)gyro.g.y-dc_offset_y)/100;
rate_z=((int)gyro.g.z-dc_offset_z)/100;
if(rate_x >= noise || rate_x <= -noise)
x += ((double)(prev_rate_x + rate_x) * sampleTime * 1.32) / 2000;
if(rate_y >= noise || rate_y <= -noise)
y += ((double)(prev_rate_y + rate_y) * sampleTime * 1.32) / 2000;
if(rate_z >= noise || rate_z <= -noise)
z += ((double)(prev_rate_z + rate_z) * sampleTime * 1.32) / 2000;
// remember the current speed for the next loop rate integration.
prev_rate_x = rate_x;
prev_rate_y = rate_y;
prev_rate_z = rate_z;
// Keep our angle between 0-359 degrees
if (x < 0)
x += 360;
else if (x >= 360)
x -= 360;
if (y < 0)
y += 360;
else if (y >= 360)
y -= 360;
if (z < 0)
z += 360;
else if (z >= 360)
z -= 360;
Serial.print(x);
Serial.print(",");
Serial.print(y);
Serial.print(",");
Serial.print(z);
Serial.print('\n');
}
}

The Processing (2.0.2) code:
Code:
import processing.serial.*;
Serial myPort;    // The serial port
float xin=0;
float yin=0;
float zin=0;
float x, y, z;
void setup() {
  size(800, 800,P3D);
  myPort = new Serial(this, "COM28", 9600);
  myPort.bufferUntil('\n');
}
void draw() {
  background(255);
  translate(width/2, height/2);;
  rotateX(xin/55);
  rotateY(yin/55);
  rotateZ(zin/55);
  pushMatrix();
  box(140);
  popMatrix();
}

void serialEvent(Serial myPort)
{
  String inString = myPort.readString();
  float[] vals = float(split(inString,","));
  xin=vals[0];
  yin=vals[1];
  zin =vals[2];
}

Regards!
180  Community / Bar Sport / Re: Surrealistic Rubik's Cube robot [Auto-solver] on: September 29, 2013, 04:08:01 pm
Radman,
Check out these facts about Rubik's cube possible positions. 43 252 003 274 489 856 000.
http://mathworld.wolfram.com/RubiksCube.html
which coincides with Hasbro...
Quote
it has 43 quintillion possible combinations
Pages: 1 ... 10 11 [12] 13 14 ... 36