Counting led blinks..


Results 1 to 40 of 93

Threaded View

  1. #28
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Counting led blinks..

    Hi, I would like to incorporate an sdcard to the project and record the number of coins, only when pressing a button (e.g RB7) , but first I want to make a seperate test program using Pic18F4550. As I understood the connection should be simple enough but just to make sure I attached an image of my connections(Please correct me if it's wrong). I found a source code but it's in C.
    Code:
     // example writing to SD card, sford 
     #include "mbed.h"
     #include "SDFileSystem.h"
     SDFileSystem sd(p5, p6, p7, p8, "sd"); // the pinout on the mbed Cool  Components workshop board
     
     int main() {
         printf("Hello World!\n");   
     
         mkdir("/sd/mydir", 0777);
         
         FILE *fp = fopen("/sd/mydir/sdtest.txt", "w");
         if(fp == NULL) {
             error("Could not open file for write\n");
        }
        fprintf(fp, "Hello fun SD Card World!");
        fclose(fp); 
    
    
       printf("Goodbye World!\n");
     }
    The code creates a folder and writes "Hello fun SD Card World" to file name "sdtest.txt".
    Hope anyone can help...

    thanks in advance,
    tacbanon
    Attached Images Attached Images  

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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