×

SparkFun Support and Front Desk will be closed on Thursday 11/14 from 1-2:30pm for a company event. Please plan to pick up your orders before or after this timeframe.

Member #314979

Member Since: April 5, 2012

Country: United States

  • Any response to this question?

  • Is there a way through S/W to pull up ain0 or do I need to use the 3.3v output with an external resistor? If you can do it in S/W, can you provide C++ code that allows me to configure the board to enable a pull up resistor on ain0. I use ubilinux with mraa. Thanks!

  • If you can provide a C++ sniplet that allows me to configure to enable a pull up resistor for ain2 and ain3, that would be great. I use ubilinux with mraa (the code i use is posted below in a comment about 5 months ago).

    Thanks!

  • If you can provide a C++ sniplet that allows me to configure to enable a pull up resistor for ain2 and ain3, that would be great. I use ubilinux with mraa (the code i use is posted below in a comment about 5 months ago).

    Thanks!

  • So happy to see this tutorial - should help a lot of people. I notice that it has a couple of broken links: "Download zip file of the repository" and the repository itself. Thanks for the tutorial!

  • I have a question: I have a battery block. Does the battery block power this block so I don't have to be tethered?

    Dave

  • As it turn out, the problem of implementing a simple bend sensor appears more difficult with this block. I need a pull up resistor and I don't have a 3.3v source with any of the blocks that I have. So it appears that, to use this block, I need to buy another block with a 3.3v source and build a custom block with the pull up logic. So I need: 1) this block 2) another block with 3.3v source 3) build a custom block with pull up resistors to use a simple bend sensor. There has to be a better way to build a wearable device. This board needs to be implemented so users can place resistors for their pull up sensors for all analog imputs. If no resistor is used, the line isn't pulled up. There are so many sensors out their that need pulling up. I'm obviously frustrated.

  • OK, I figured out the problem. I can't simply connect the to bend sensor leads to this board. I need to add my own pull-up resistors (should have known). Dave

  • As I stated earlier, my pressure sensor works (Flexiforce) but my bend sensor (FS7548) doesn't. But I also get small values for the Flexiforce (0 - 19). I always get 0 for the FS7548. I thought this board contains pull up resistors to 3.3v. I also assume we can put multiple analog sensors on the board and switch between them at runtime. Any clues from anyone about why I'm getting this?

  • Heres my code for Ubilinux using mraa to read an analog sensor from AIN2 (so others can benefit):

    #include "mraa.h"
    #include <signal.h>
    
    int running = 0;
    
    void sig_handler(int signo)
    {
    if (signo == SIGINT) {
        running = -1;
    }
    }
    
    int main(int argc, char** argv)
    {
    int a2_oper_status = 0b0 << 7;
    int a2_input_mux = 0b110 << 4; // AIN2-GND
    int a2_gain_amplifier = 0b010 << 1;
    int a2_mode = 0b0 << 0;
    int a2_data_rate = 0b100 << 13;
    int a2_comp_mode = 0b0 << 12;
    int a2_comp_polarity = 0b0 << 11;
    int a2_comp_latching = 0b0 << 10;
    int a2_comp_queue = 0b11 << 8;
    uint16_t a2_word = a2_oper_status +
              a2_input_mux +
              a2_gain_amplifier +
              a2_mode +
              a2_data_rate +
              a2_comp_mode +
              a2_comp_polarity +
              a2_comp_latching +
              a2_comp_queue;
    printf("a2_command 0x%X\n",a2_word);
    
    mraa_i2c_context i2c = mraa_i2c_init(1);
    if (mraa_i2c_address(i2c, 0x48) != MRAA_SUCCESS)
        printf("can't find i2c sensor\n");
    signal(SIGINT, sig_handler);
    while (running == 0) {
        if (mraa_i2c_write_word_data(i2c, a2_word, 0x01) != MRAA_SUCCESS)
       printf("can't write a2 command\n");
        uint8_t a2_sensor_value = mraa_i2c_read_byte_data(i2c, 0);
        printf("%d\n",a2_sensor_value);
        sleep(1);
    }
        printf("Closing I2C\n");
    mraa_i2c_stop(i2c);
    }
    

No public wish lists :(