Adafruit Motor Shield - Microstepping
This is not really a tutorial, just a small piece of information regarding the microstepping.
@Mark Read · 2020-07-24
This is not really a tutorial, just a small piece of information regarding the microstepping.
Here is some code to demonstrate using a single stepper motor, an Uno, the Adafruit Motor Shield and a three-way switch.
The Arduino generates an accurate 1 second time base for the counter by cascading timer0 and timer2. Part of the B4R code is in C for setting the timers/counters of the Atmega, this way the accuracy is determent by the 16 MHz crystal. The link between digital inputs 3 and 4 connects the output of timer2, 250 Hz, to input of timer0. The software uses the output of timer0 (1Hz) when go positive to start the count of frequency input to timer1. Timer1 is a 16 bits timer, it overflows at the count of 2 power of 16, that in turn advances over-flow register. At the end of the 1 second the 16 bit register is recorded. The Arduino sends via OTG (On The Go) cable or adaptor 1 byte as a key + 3 bytes of the measured frequency. The specs recommend up to 6 MHz, I tested it at 2 MHz. The Android app display 0 to 9 images of nixie tubes.
Control inputs and output of Arduino with Android. Switch 4 Arduino outputs by the toggle switches and read 4 inputs by the 4 lights, read voltage of 2 analogue inputs and adjust analog output (PWM). Digital inputs are pulled up. Analog inputs not used can be connected to GRD. The Arduino update data every 1 second. Library felUsbSerial has to be added to the B4A code, can be downloaded from GitHub.
I use inline C in my B4R projects quite a bit in my projects. Mostly I have some C/C++ code I want to call from B4R subs - that''s well documented on the forum (the Inline C intro here). From time to time though I need to call a B4R sub from C/C++ - this post does a decent job of explaining how to do that. What I wanted to do is expand on the second concept and take it a step further and use function pointers to create a call back mechanicism from your C/C++ code into B4R.
Looking in the tutorial section of B4R I noticed that there was no example of how to connect and use the joystick module. So here is an example
The file in the link contains some notes for me I devised from a lot of tutorials on how to burn a bootloader to a ATMEGA328P-PU wired on a breadboard. See also the tutorial "Shrink your Arduino project to the minimum".
This is a very useful tutorial by the guy in dronebotworkshop which opened new horizons for me since I didn''t know there were two kinds of shift registers (actually four).
Custom character creation for LCD
Visualizing MPU6050 Accelerometer and Gyroscope - Pitch, Roll and Yaw with inline C and Processing
Visualizing ADXL345 3-axis Accelerometer Pitch and Roll with inline C and Processing
B4R v1.20 added support for ESP8266 modules. ESP8266 is a great module for IoT solutions. For a few dollars you get a powerful microcontroller with built-in support for wifi.
Cracked it - can connect the DS3231 to any 2 digital pins of my Nano and read the date, time, and temperature by making use of the B4A core library only. All control of the SDA (data) and SCL (clock) lines are hard coded. So, don''t have to connect it to the traditional I2C pins and don''t have to use a SD3231 or the Wire library.
The attached project implements the I2C communication protocol to set the Date and Time of a DS3231 RTC module. The protocol is hard coded (i.e no library) and you can therefore use any 2 digital pins of an Arduino Uno/Nano/etc to connect to the SDA and SCL pins of the DS3231.
LEDStrip - different themes for different holidays
I have one of the "MH-REAL-TIME CLOCK MODULES - 2" with a DS1302 chip. I thought it would be interesting to see if I could read the seconds, minutes, hours, year, month, day of month, and day of week from the module without making use of a library i.e hard coding the data extraction as a learning exercise.
Looking for free PCB design software I came accross the EasyEDA. It is one of the best I have seen since you get to design multilayered PCBs and see the designed PCB in 3d view.
Creates random numbers (byte) from 0 to 255. Have added it via inline C code. Below table is a summary of the number of times (right column) that 0 to 255 (left column) were generated out of 1605 randomly generated numbers. Only numbers 9 and 44 never appeared (from 0 to 255) in the 1605 long random number list.
I am using an Arduino Nano to control the 12 LEDs using pins 8, 9, 10, and 11 of the Nano. Just thought it would be interesting to give Charlieplexing a go.
Use and change font in rAdafruitGFX for TFT screen
The sensor signals when a sensor shake happens. It''s a simple sensor (detected/not detected) and a simple circuit.
I''m using an ESP32CAM camera board with 4GB of PSRAM (like extended memory for the camera). I''m using one similar to this one you can find on Amazon. The board has an OV2640 2MP camera and an SD card slot (it''s worth mentioning this model does not have a USB interface so you''ll need an FTDI programmer).
How to get and parse Json from an Http server, inline C code
Check blue tooth communication of your creations
How to load our Arduino sketch directly (or indirectly) in an ATMega328P-PU microcontroler to place it on a breadboard.
I found this application on Play Store and it is very useful for prototyping using components
Arduino Simulator
Memory, Variables and Objects
This is a very simple example shows how to drive 4-digits 7-segment display with MAX7219 and rLedControl library, this code example displays ''HoLA'' word, you can add more digits and MAX7219 devices. Each MAX device can drive up to 8 7-segment digits. 33K ohm resistor should be connected between pin 18(ISET) and pin 19(V+) of MAX7219, not shown in provided datasheet. Datasheet and connection links below.
Resistance color specs reading - Billy Brown habits