Giter Club home page Giter Club logo

Comments (2)

benevpi avatar benevpi commented on August 17, 2024

Just to add to this, I don't think the buzzer pin for the Input and Display micromod board (PWM1) is defined at all. I've been able to access the buzzer with:

#define BUZZERPIN PIN_A2+1

from arduino_boards.

edspark avatar edspark commented on August 17, 2024

First thanks for the issue! So in the Arduino IDE, your regular digital pins (D0, D1, D2) you call using the number without the letter D.

For example:

pinMode(0, OUTPUT); 
digitalWrite(0, HIGH);
digitalWrite(0, LOW); 

The use of the #define that you've mentioned in your first comment is a totally viable solution. You might also see something like

int csPin = 0; 
int dcPin = 1; 

pinMode(csPin, OUTPUT)
digitalWrite(csPin, HIGH);
digitalWrite(csPin, LOW); 

// Or however these pins are used, this is just an example

As to your second comment, you've found a solution but one that isn't exactly user friendly. What you've done is called the value PIN_A2 that is set in the variant.h file and then incremented to A3 by adding one which conincidentally is the next entry in the PinDescription list. That will not always work, though it will work most of the time. You can simply call A3:

pinMode(A3, OUTPUT);

A3 is the pin number for PWM1 on the SAMD51. Here's a picture from the schematic:

image

Note that you're able to use "A3" to call an analog pin where you would not be able to call a digital pin in the same manner "D3". If you have anymore questions about pin numbering please check out our hookup guide on the SAMD51 MicroMod:

https://learn.sparkfun.com/tutorials/micromod-samd51-processor-board-hookup-guide/hardware-overview

This post did make me realize that those PWM pins may be nice to call directly, and I'll get that changed so that in the future you can do a:

#define BUZZERPIN PWM1

from arduino_boards.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.