Skip to content

Instantly share code, notes, and snippets.

@BhavyaC16
Last active August 26, 2020 18:53
Show Gist options
  • Save BhavyaC16/aa722bd7d9fe549fce4178e196efb0a7 to your computer and use it in GitHub Desktop.
Save BhavyaC16/aa722bd7d9fe549fce4178e196efb0a7 to your computer and use it in GitHub Desktop.

14/01/2019

  1. Pwm
  2. Calculation of duty cycle for pwm
  3. ADC resolution

analog write commands can be written only on the pins 3,5,6,9,10,11, ie, the pins with a tilde(~) sign in front of them

3,9,10,11 – 490Hz

5,6 – 980Hz

calculation of output volatge from the value generated:

Vout = digital value * Vref/(2^n -1)

eg, Vout = 65*5/((2^8)-1)

class activities:

controlling the intensity of led using pwm (led as actuator)

controlling the position of servo motor using pwm (motor as actuator)

servo commands

attach()

servo.attach(pin)

servo.attach(pin.max,min)

write()

servo.write(angle)

map()

map(value, fromLow, fromHigh, toLow, toHigh)


16/01/2019

Mobile android Programming

android – ecosystem:Google

iOS – ecosystem: iPhone

windows

Blackberry

Android – OS based on linux kernel, open source, large deveopment community

inter app integration

system architecture of android:

  1. Linux Kernel – Driver display, usb drive, camera...
  2. Libraries, Android Runtime
  3. Application framework
  4. Applications

MIT App inventor

Android Studio

Unity 3D

B4A


21/01/2019

Bluetooth version 2.0

BLE – bluetooth low energy – sends data in short ranges and packages, can run for 4-5 yrs, consumes low energy

HC05 model – used for continuous streaming model, consumes more energy

used in accordance with their application

eg – BLE – ecg monitoring, industrial processes

HC05 – music streaming

WiFi – range is upto 300m, star topology, many connections as opposed to a bluetooth with one to one connections, easy to add and remove nodes, not as secure as bluetooth, can be easily hacked

Zigbee – mesh topology

GPS

GSM

Software serial.pin library has to be used to have pins other than 0 and 1 to act as Tx and Rx


06/02/2019

Selecting the Microcontroller: - I/O pins - reqd Peripherals(RAM,ROM...) - reqd Interfaces(USB,UART,I2C...(protocols)) - IC Packages - affordability - availability, future availability - support for the device(application and technical forum support)

Search:General Hardware block Diagram for a microcontroller

Communication Protocols: - Serial Peripheral Interface(SPI) - Master Slave Relationship - 4 Pins: - MOSI(MasterOutput/SlaveInput) - MISO(MasterInput/SlaveOutput) - SCLK(Clock)(line for synchronus clock signal to all sensors/slaves) - Select Line for activation of a specific slave - Disadvantage: 4 bytes of data due to 4 lines - followed by: Pressure sensor, Dual axis tilt sensor - Inter Integrated Circuits(I2C) - only 2 lines : SCL and SDA, one for serial clock input and the other for serial data - The master also sends and address along with the serial data to choose the slave to which the data has to be sent. After address matching, the slave sends a low SDA to the master as an acknowledgement. Hence a communication b/w the master and the slave is setup. - Disadvantage: too manny steps have to bbe performed to establish and stop communication. - UART - Rx,Tx - Asynchronous - 3 types of communication: - Simplex - Half Duplex - Full Duplex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment