Author Topic: Arduino 1.8.6 Library?  (Read 479 times)

0 Members and 1 Guest are viewing this topic.

Offline CaptDonTopic starter

  • Super Contributor
  • ***
  • Posts: 2123
  • Country: is
Arduino 1.8.6 Library?
« on: November 20, 2024, 03:27:57 am »
Maybe there is a better subgroup on this forum for this question, but here goes. I am running an old version of the Arduino app 1.8.6 which is the newest version to run on my old 32 bit Gateway ROG450 laptop. Is there a way to print the contents of the library? I am running the Nano module. Sadly, mine had the chinesium CH341 Comm chip and I had to jump through hoops to get a USB comm port to show up. The are lots of 'Examples' that you can load and run but I would like to see all of the 'commands' for lack of a better term that are available. I am a total newbie to this stuff and the Nano was given to me in trade for some other I.C.'s I had on hand. Thanks for any leads or links.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 930
  • Country: ca
Re: Arduino 1.8.6 Library?
« Reply #1 on: November 20, 2024, 07:12:43 am »
It appears that you're new to microcontrollers.

Quote
"Arduino app 1.8.6"
You're probably referencing the Arduino IDE version 1.8.6 archive (made for either Linux, Windows, or MacOS).  This is a whole directory tree of files including: integrated development environment/editor, cross compiler tools, C/C++ source code for base functions and some optional libraries (supporting hardware such as LCDs, stepper motors, servos, WiFi, etc.).

Quote
"Is there a way to print the contents of the library?"   "...see all of the 'commands' ..."
Consult the reference manual on what functions are available to call when writing your "sketch" (the C/C++ program to be uploaded to the microcontroller).  See "Language Reference" here.  Each optional library will have their own reference documentation (same link).  Also see the "Variables" and "Structure" tabs (under "Language Reference") to get acquainted with the C Language parts and here on how to upload your sketch to the Nano.  You can also consult any C/C++ Language book/tutorial. Unfortunately, I haven't been able to find documentation on the avr-gcc Standard C and math libraries included (they're here: /arduino-1.6.8/hardware/tools/avr/avr/lib/libc.a and libm.a).

Quote
"Nano module"
Is a hardware implementation (board) containing a ATmega328 microcontroller (schematic here).  There are many boards in the Arduino ecosystem.  See here for their current and past lineup.  Their original, popular "UNO" board has an ATmega328 microcontroller from Atmel (now Microchip).  The Nano is a smaller form-factor version of this. The newer boards may have faster, different processors with additional peripherals (eg. WiFi).  The idea is that all boards can run basically the same sketch but with different references to pins or peripherals specific to the board the sketch is uploaded to.

Quote
"mine had the chinesium CH341 Comm chip"
It's likely not a genuine Arduino brand board. But that's okay. I would expect it to behave like a genuine Arduino Nano.

Seek out Nano or UNO sketch examples/projects on the Internet.
« Last Edit: November 20, 2024, 07:25:29 am by pqass »
 
The following users thanked this post: CaptDon

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4629
  • Country: nl
Re: Arduino 1.8.6 Library?
« Reply #2 on: November 20, 2024, 07:51:09 am »
You might want to look at Linux to install on your old laptop. There are still distro's for it and work with the CH340 or CH341 controllers out of the box. It maybe is even possible to build the version two IDE on it.

But that is not your question, which is answered by qpass.

The Arduino environment exists of many layers and are not so easy to browse through. As there are many target MCU's by now you can find directories specific for each of these MCU's, but there are also higher level libraries that work for all of these MCU's. One does have to be vigilant though, because not all of the libraries out there are behaving this way.

As a beginner it is best to stick to the documentation provided by Arduino and given in the previous post. With the Arduino nano, real or clone, you have a safe target that will work with most of the stuff out of the box. There might be an issue with the boot loader being an old or new version, but that is solvable when you run into problems with that.

Anyway, have fun with your new toy.

Offline CaptDonTopic starter

  • Super Contributor
  • ***
  • Posts: 2123
  • Country: is
Re: Arduino 1.8.6 Library?
« Reply #3 on: November 20, 2024, 02:22:30 pm »
Fortunately, I have dabbled in Dev-C++ and some older C releases so the C language is familiar to me. I am looking for the list of things like 'pinMode', 'analogWrite', 'digitalWrite', etc. The words or text that are Arduino based functions that aren't native to a person familiar with ANSI C. They show up in reddish brown in the sketches. What is the correct term for these? Functions? Commands? Macros? Sorry to seem so dumb. I will continue to browse the 'Examples' sketches for available functions (or whatever is the proper term). My forte in my hayday was machine code and assembly language for the 8080 / 8085 / Z-80 8 bit CPU's. I still get calls to patch code for old industrial machines that operate using these old devices. I do keep a stock of the 74XX and 74XXX stuff as well as the old 'helper' I.C.'s like UART's, PIA's, RIOT's and of course a pile of different EPROM's for plug and play updates and board repairs. Thanks mates!!! Lot's of great Elmers and Mentors here on EEVBLOG!!!
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 3189
  • Country: gb
Re: Arduino 1.8.6 Library?
« Reply #4 on: November 20, 2024, 02:31:00 pm »
Quote
I am looking for the list of things like 'pinMode', 'analogWrite', 'digitalWrite', etc. The words or text that are Arduino based functions that aren't native to a person familiar with ANSI C. T
something like this? https://docs.arduino.cc/language-reference/
 
The following users thanked this post: CaptDon

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4629
  • Country: nl
Re: Arduino 1.8.6 Library?
« Reply #5 on: November 20, 2024, 02:58:55 pm »
Fortunately, I have dabbled in Dev-C++ and some older C releases so the C language is familiar to me. I am looking for the list of things like 'pinMode', 'analogWrite', 'digitalWrite', etc. The words or text that are Arduino based functions that aren't native to a person familiar with ANSI C. They show up in reddish brown in the sketches. What is the correct term for these? Functions? Commands? Macros? Sorry to seem so dumb. I will continue to browse the 'Examples' sketches for available functions (or whatever is the proper term). My forte in my hayday was machine code and assembly language for the 8080 / 8085 / Z-80 8 bit CPU's. I still get calls to patch code for old industrial machines that operate using these old devices. I do keep a stock of the 74XX and 74XXX stuff as well as the old 'helper' I.C.'s like UART's, PIA's, RIOT's and of course a pile of different EPROM's for plug and play updates and board repairs. Thanks mates!!! Lot's of great Elmers and Mentors here on EEVBLOG!!!

If your forte was (is) machine coding, you can easily do so on the AVR architecture based MCU on your nano.

Everything about the chip can be found here: https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf

It is also possible to program the thing with bare metal C. I do not know what compiler or assembler to use on Windows though, but under Linux there is the gnu compiler for it.

A lot of the support chips you have still lying around have functional equivalents in the ATmega328P chip.

The names you mentioned are either functions or macros depending how they have been implemented. The language reference provided by qpass and themadhippy shows them all. Be aware that pin naming can vary based on target board. The original board for the Arduino framework was the UNO, for as far as I'm aware, and the pin numbering is based on that one. The nano is the small version of it so the pins are the same, if not mistaken. I'm not a big user of the Arduino framework.

Since the Arduino framework uses C++ you have for instance the object "Serial" which is a class that has several functions like serial.read() that allows you to get data from the serial buffer if there is any. Serial will be used in lots of examples.

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 166
  • Country: us
Re: Arduino 1.8.6 Library?
« Reply #6 on: November 23, 2024, 04:16:51 pm »
It seems to me that you are asking about the "standard Arduino library," not to be confused with standard C or C++ libraries. This library implements the various functions that we can take for granted when programming a device using the Arduino platform - functions such as digitalWrite or analogRead, and also classes such as HardwareSerial that are instantiated as the Serial object.

On my Linux system, this library (or much of it) is found here:

Code: [Select]
myusername@mymachine:~/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino$ ls
abi.cpp                   hooks.c           Server.h         wiring.c
Arduino.h                 IPAddress.cpp     Stream.cpp       wiring_digital.c
binary.h                  IPAddress.h       Stream.h         wiring_private.h
CDC.cpp                   main.cpp          Tone.cpp         wiring_pulse.c
Client.h                  new               Udp.h            wiring_pulse.S
HardwareSerial0.cpp       new.cpp           USBAPI.h         wiring_shift.c
HardwareSerial1.cpp       new.h             USBCore.cpp      WMath.cpp
HardwareSerial2.cpp       PluggableUSB.cpp  USBCore.h        WString.cpp
HardwareSerial3.cpp       PluggableUSB.h    USBDesc.h        WString.h
HardwareSerial.cpp        Printable.h       WCharacter.h
HardwareSerial.h          Print.cpp         WInterrupts.c
HardwareSerial_private.h  Print.h           wiring_analog.c

As you can see, you have to dig deeply into the directory structure of the hidden directory where the IDE stores things. (It is hidden on my Linux system; on a Windows system, maybe it under the normally-hidden AppData directory?)

Notice this sequence in the directory structure: .../packages/arduino/hardware/... - under packages you will find sub-directories for different board families. On my system, I see sub-directories for ATTiny and ESP8266, because I have downloaded those packages to be able to use the Arduino IDE with corresponding boards. The "arduino" package is the standard package that supports the typical Arduino boards (and their clones), such as the Nano.

Once you dig down to the right sub-directory, you can poke around these files. You will find the definition of the digitalWrite function in the wiring_digital.c, for example.

One other comment: on the 2.x version of the Arduino IDE, you can right-click on a function (such as digitalWrite), and one of the pop-up menu options it offers is to go to the definition - this will load that library file into the IDE so that you can examine it. I don't recall if that worked under 1.8.6, but give it a quick check to see ...
 
The following users thanked this post: CaptDon


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf