Tuesday, November 28, 2023

Is my set-up working?

via HW: Blink LED and SW: hello world

  • HW needed: Arduino Uno R3   (or Tinkercad Arduino Uno)
  • SW needed: Arduino IDE 2.x  is now there. Total rewrite. Even if using simulation, it is helpful to see default and example codes. so File>Examples> ...   is still useful.

  • Alt. HW/SW: Tinkercad, a design and simulation tool will be used for examples.   Nice for design and testing before buying.  [Also at of post, I'm traveling with no HW.] It is useful for more than just Arduino simulations.
Programming language: C

Hello world s

HW Connection working?

Blink an LED is the  HW Hello World when using a microcontroller. It tests that the communication between your computer and the microcontroller work.

So running blink example is a good way to test if your Arduino to your computer communication is working correctly.  The blink example code blinks the LED next to pin 13.   
file>examples>basics>blink

From Arduino IDE  1) Verify and 2) Upload  
If the LED on the Arduino board is blinks then the communication is working.

Notice:
In blink C code notice that LED must be setup via  a C #define name is used to identify the LED.
The pin mode must be initialized in setup() via calling the pinmode(LED pin, mode) 

SW Hello World

file>new  Provides and empty setup() and loop() functions.
Print "hello world" once only needs setup() function.

Arduino "print" output goes to the serial monitor,
   so need to use Serial.print(...) and Serial.println(,,,).
  1. in setup() function add:   Serial.begin(9600) // where 9600 is the baud rate most commonly used.
  2. Then Serial.println("Hello world") can be added.
Remember anything in loop() function" will be keep being repeated. If value changes then want print in loop(). If value doesn't change, then want print only in setup() function, like a title line.

Output appears in the Serial Monitor.
Try both HW blink and SW Hello World to serial monitor.

HW:
Create +  > Circuit Design
Drag an Arduino Uno  into your design area

SW:
1, Click on Code button
    Arduino Uno component comes with blink code (blocks, text, both) in Tinkercad.
    Default to seeing the block code. You may find this helpful if moving from block code to C.
2, In dropdown chose text  to just see the C code
3. Start Simulation button does both the equivalent of Compile and Upload

From IOT viewpoint

I'm taking the Coursera IOT specialization in hopes of learning enough to do my own IOT projects besides learning more for teaching. It repeats Arduino basics, but emphasis is on enough of an overview to research and do your projects when course finished. 

Coursera IOT specialization
Courses 4&5 are on Raspberry PI. First course is overview of IOT concepts and last course is an independent project using specialization concepts.

Overview Tools, concepts, and related simple projects will be shared, but this first entry is overview of tools  and IOT viewpoint taken. More concepts covered.  The next few posts will emphasize concepts, whys, best practices where known,  more than just how-to. Any differences between simulations and using hardware will be included where known.

Internet of Things (IOT)  projects vs stand-alone projects:
IOT projects connect to internet so the data can be looked at, changed, saved and stored outside of the device.

Stand-alone projects can expanded to become IOT projects.   HW to connect to the internet or a device connected to the internet needs to be available or added.






Arduino and pump

Motor Driver witn 9110 or 9110S  https://www.laskakit.cz/user/related_files/l9110_2_channel_motor_driver.pdf https://docs.sunfounder.com/pro...