2.Group Assignment: compare the performance and development workflows for other architectures
3.Individual Assignment:
Files:
Tools:
This is the datasheet for the ATTiny84 - here
The Datasheet of a microcontroller is vast compost of information, much of it being not immediately useful.
The main things to look out for are:
void setup() {
DDRA = (1 << PA2);//OUTPUT LED on PA2
}
void loop() {
PORTA = (1 << PA2);//LED is ON
delay(1000);
PORTA &= ~(1 << PA2);//LED is OFF
delay(1000);
}
I tried uploading this code using Arduino IDE. It was working before, but it isn't now. Tried for an hour or so. The problem turned out to be with the resonators.
DDRB |= (1 << 2) This particular code changes the value in 2nd pin of DDRB into '1', and leaves the rest as it was before.
make hex into the terminal. It failed.#define F_CPU 20000000 line, and it worked
By the way, remember to set the environment variables everytime a new instance of the terminal is opened. I wasted 1 hr on this.
#define RX 0
#define TX 1
#include
SoftwareSerial myserial(RX, TX);
void setup()
{
myserial.begin(9600);
}
void loop() {
myserial.print("ch")
}
Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "NodeMCU-32S, 80MHz, 921600"
Sketch uses 198856 bytes (15%) of program storage space. Maximum is 1310720 bytes.
Global variables use 13276 bytes (4%) of dynamic memory, leaving 314404 bytes for local variables.
Maximum is 327680 bytes.
esptool.py v3.0-dev
Serial port COM8
Traceback (most recent call last):
File "esptool.py", line 3682, in
File "esptool.py", line 3675, in _main
File "esptool.py", line 3329, in main
File "esptool.py", line 263, in __init__
File "site-packages\serial\__init__.py", line 88, in serial_for_url
File "site-packages\serial\serialwin32.py", line 62, in open
serial.serialutil.SerialException: could not open port 'COM8': WindowsError(5, 'Access is denied.')
Failed to execute script esptool
the selected serial port Failed to execute script esptool
does not exist or your board is not connected
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
# Make sure you have the Servo checkbox marked!
import machine
import pyb
# The pyboard has four simple servo connections
servo = pyb.Servo(1)
servo.angle(0)
#define TOUTCH_PIN T0 // ESP32 Pin D4
#define LED_PIN 2
int touch_value = 100;
void setup()
{
Serial.begin(115200);
delay(1000); // give me time to bring up serial monitor
Serial.println("ESP32 Touch Test");
pinMode(LED_PIN, OUTPUT);
digitalWrite (LED_PIN, LOW);
}
void loop()
{
touch_value = touchRead(TOUTCH_PIN);
Serial.println(touch_value); // get value using T0
if (touch_value < 50)
{
digitalWrite (LED_PIN, HIGH);
}
else
{
digitalWrite (LED_PIN, LOW);
}
delay(1000);
}
#include "WiFi.h"
String networkSSID = "";
int strengthSignal = -9999;
void setup()
{
// Initialize Serial to log in Serial Monitor
Serial.begin(9600);
// configuring the mode of operation of WiFi as station
WiFi.mode(WIFI_STA);//WIFI_STA is a constant indicating the station mode
// disconnect from the access point if it is already connected
WiFi.disconnect();
delay(100);
// Serial.println("Setup done");
}
void loop()
{
// Serial.println("scan start");
// performs the scanning of available networks
int n = WiFi.scanNetworks();
Serial.println("Scan performed");
//check if you have found any network
if (n == 0) {
Serial.println("No network found");
} else {
networkSSID = "";
strengthSignal= -9999;
Serial.print(n);
Serial.println(" networks found\n");
for (int i = 0; i < n; ++i) {
//print on serial monitor each of the networks found
Serial.print("SSID: ");
Serial.println(WiFi.SSID(i)); //network name (ssid)
Serial.print("SIGNAL: ");
Serial.print(WiFi.RSSI(i)); //signal strength
Serial.print("\t\tCHANNEL: ");
Serial.print((int)WiFi.channel(i));
Serial.print("\t\tMAC: ");
Serial.print(WiFi.BSSIDstr(i));
Serial.println("\n\n");
if(abs(WiFi.RSSI(i)) < abs(strengthSignal))
{
strengthSignal = WiFi.RSSI(i);
networkSSID = WiFi.SSID(i);
Serial.print("NETWORK WITH THE BEST SIGNAL FOUND: ( ");
Serial.print(networkSSID);
Serial.print(" ) - SIGNAL : ( ");
Serial.print(strengthSignal );
Serial.println(" )");
}
delay(10);
}
}
Serial.println("\n------------------------------------------------------------------------------------\n");
// interval of 5 seconds to perform a new scan
delay(5000);
}