Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: How conect micro SD card with ArbotiX-M

  1. #21
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,282
    Images
    27
    Rep Power
    275

    Re: How conect micro SD card with ArbotiX-M

    If you add debug messages that should always print out when a library function runs but it does not appear, then you are not modifying the correct copy of the library (very likely) or the library is not being rebuilt (rather difficult to achieve when using arduino).

    If you are using the board manager, then modifications should only and always be made to the contents of the '/home/.arduino15/packages/arbotix/' folder tree. That is where the arbotix-m installation is located on linux and should be in a very similar location on windows.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh

  2. #22

    Re: How conect micro SD card with ArbotiX-M

    For what it is worth, I was making an order to sparkfun and needed a couple $ more for free shipping, so picked up microSD breakout:
    https://www.sparkfun.com/products/13743

    I then hooked up the adapter using similar pin numbers as mentioned in #10 Also added pin 3 for the other pin which I believe can detect if sd is inserted or not.

    Pictures showing hookup:
    Click image for larger version. 

Name:	Arbotix MicroSD 1.jpg 
Views:	106 
Size:	94.7 KB 
ID:	7193Click image for larger version. 

Name:	Arbotix MicroSD 2.jpg 
Views:	109 
Size:	107.3 KB 
ID:	7194

    Again your program:
    Code:
    #include <SPI.h>
    #include <SD.h>
    File myFile;
    
    
    void setup()
    {
      Serial.begin(9600);
      Serial.print("initializing SD ...");
      if (!SD.begin(4)) {
        Serial.println("It failed to initialize");
        return;
      }
      Serial.println("successful initialization");
     
      myFile = SD.open("Prueba.txt");//WE OPEN THE FILE 
      if (myFile) {
        Serial.println("Prueba.txt:");
        while (myFile.available()) {
          Serial.write(myFile.read());
        }
        myFile.close(); //WE CLOSE THE FILE
      } else {
        Serial.println("Error opening the file");
      }
    }
    
    
    void loop()
    {
      
    }
    I uploaded using FTDI (after I used AVR programmer to put bootloader back on)

    Output from run:
    Code:
    initializing SD ...successful initialization
    Prueba.txt:
    Line 1
    Line 2
    Note: this was a brand new 16gb SD Card assuming probably FAT32 formatted. Soon to be RPI3 card for new RPI3 B+...

    Note: for power I am using +5v/GND from the 3 pin header associated with D4...
    Program is using the latest version of SD library

    As you can see in some of the build warning information
    Code:
    Multiple libraries were found for "SD.h"
     Used: C:\Users\kurte\Documents\Arduino\libraries\SD
     Not used: D:\arduino-1.8.5\libraries\SD
    Note: My SD library comes from: https://github.com/PaulStoffregen/SD

  3. #23

    Re: How conect micro SD card with ArbotiX-M

    Hi KurtEck! Thank you for answer me another time!! Sorry but I was on holidays and I didn´t reed the message since today.

    I already have proved this hookup and it´s okey!!!

    the only difference between your conection and my conection was that i didn´t conect the pin 3, but know every thing is equal and the Micro SD card is recognised!!!

    Why did you believe that the pin 3 allows to say if the SD is inserted or not??? I didn´t understand yet.

    Another time, thank you!

    Now, i will try to store the movements of the robotic arm in the SD card, in order to have much more SRAM memory!!

    I will put here my advances!

    Urko.

  4. #24

    Re: How conect micro SD card with ArbotiX-M

    Hellow to everybody!

    As I have said, I will put my advances:

    During this two weeks I have worked in trying to save the movements of the sequences in the SD, and finally i have done, using the SD.h library (correctly).

    Basically, I have used the followings codes and blocks:

    First, to start the connection between the SD and the PC-Arduino:
    Code:
      Serial.print("Iniciando SD ...");
      if (!SD.begin(4)) {
        Serial.println("No se pudo inicializar");
        return;
      }
      Serial.println("inicializacion exitosa");
    Second, i have use the following code to open/create a file and to save there the movements of the servos and them to close the file:
    Code:
     myFile = SD.open("Prueba.txt", FILE_WRITE); // Note
    
        if(myFile)
            Serial.println("file is open");
        else
            Serial.println("Error opening the file");
    
    ...
    
    int pos = dxlGetPosition(SERVO_ID[j]);
          myFile.println(pos); //read and save the actual position
    ...
    myFile.close(); //close the file
    Third, I have add a new variable in the program (this variable datas come from the SD), and I have used like the variable of the position that I have put in the previous posts, to read you datas i have used myFile.parseint :

    Code:
    int pos_from_file[servo_count]; 
    ...
    pos_from_file[i] = myFile.parseInt(); 
    And finally this block to delete the file at the end of the program:
    Code:
       if (SD.exists("Prueba.txt")) {        // SI EXISTE EL ARCHIVO
        SD.remove("Prueba.txt");           // ELIMINAR ARCHIVO
        Serial.println("SD FILE REMOVED");
      } else {
        Serial.println("THE FILE DOESN´T EXIST");
      }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Error uploading arduino program to arbotix card
    By urko_18 in forum Arbotix, Microcontrollers, Arduino
    Replies: 2
    Last Post: 11-21-2017, 08:53 AM
  2. hobby pwm micro servo on Arbotix pro
    By dottuli in forum HR-OS1 Development and Discussion
    Replies: 2
    Last Post: 10-01-2015, 06:37 PM
  3. USB Business Card
    By jdolecki in forum Robotics General Discussion
    Replies: 1
    Last Post: 10-28-2010, 03:12 PM
  4. Question(s) micro servos for a micro hexapod
    By gallamine in forum Humanoids, Walkers & Crawlers
    Replies: 3
    Last Post: 01-23-2010, 12:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •