Beginner Led blinking pin

Posted on
  • Hello , I have received my official board today and I try to make blinking a led on my breadboard and nothings happends. With the same circuit on my Arduino it's ok. Can anyone explain me how we choose the pins?

    This is an example in Ruby for arduino wich works well.

    *require "rubygems"
    require "arduino_firmata"
    
    arduino = ArduinoFirmata.connect
    puts "firmata version #{arduino.version}"
    stat = true
    5.times do
        puts stat
      arduino.digital_write 11, stat
     stat = !stat
        sleep 0.2
    end
    15.times do
        puts stat
      arduino.digital_write 11, stat
     stat = !stat
        sleep 2
      
    end*
    
  • Hi,

    You should be able to use pretty much anything here. I'd avoid the ones with Purple boxes by them though - they are sometimes used for other things.

    The circuit should be the same as for Arduino - just an LED and resistor. Like with the Arduino the LED must be around the correct way though.

    About the simplest blinking light you can do is as follows - this one will blink the first LED:

    setInterval("digitalWrite(LED,a=!a)",100­);
    

    For instance try connecting the LED to pin A8, and then type:

    setInterval("digitalWrite(A8,b=!b)",100)­;
    
  • I can do for the first but with the others code nothing happens . I think I will try to make a video

  • Ok now it's working with A9 but not with A8

    Sorry all is ok now I have forgotten to change the pin . Thanks for your help.

  • No problem! Glad you got it working!

    Just so you know, A9 is one of the pins marked with purple here that you might want to avoid. It'll work, but if you ever solder bluetooth on then you won't be able to use that and bluetooth

  • Ok . It's an amazing board , it could be nice if someone would write a book about Espruino . Next month I will present Espruino to french's javascript developers .

  • Isn't A9 pulled high by the idle serial port?

    https://github.com/espruino/Espruino/iss­ues/142

  • I'm pretty sure A9 is fine once you start to write to it with digitalWrite.

    However because of the STM32F1, it gets interesting if you try and use it for a 'peripheral' that's not GPIO :) The F4 in the Pico has a much better arrangement and won't suffer from those kinds of issues...

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Beginner Led blinking pin

Posted by Avatar for polaroid62 @polaroid62

Actions