ATTiny10IDE icon indicating copy to clipboard operation
ATTiny10IDE copied to clipboard

serial monitor for attiny10

Open osintes opened this issue 5 years ago • 1 comments

hello , thank for your proyect , I request for monitoring serial , this featured as debugging , thnak

like... #pragma clock 8000000

#include "Arduino.h" //#include "Monitor.h" #include "SoftwareSerial.h"

SoftwareSerial mySerial(3);

int sensitive = 185; // สำหรับ 5A // int sensitive = 100; // สำหรับ 20A // int sensitive = 66; // สำหรับ 30A

int offset = 2525; // ค่าเริ่มต้น 2500 ปรับค่าตรงนี้เพื่อให้ค่ายังไม่มีโหลดเป็น 0.00

void setup() { mySerial.begin(9600);

}

void loop() { double c = getCA(); mySerial.print(c); delay(1000); }

// หาค่ากระแสเฉลี่ย double getCA() { int count = 200; double sum = 0; for (int i = 0; i < count; i++) { sum += getC(); } double val = sum / count; return val; } // อ่านค่ากระแส double getC() { int a = analogRead(A0); double v = (a / 1024.0) * 5000; double c = (v - offset) / sensitive; return c; }

osintes avatar Oct 03 '19 09:10 osintes

Thanks for the suggestion. I have plans to support some type of monitoring, but it's still in development. You might also want to check another project of mine, "AVR/Arduino Hardware Debugger on the Cheap (part 3)" which can use an Arduino to debug an ATTiny, such as an ATTiny85. I'm hoping to eventually support something like this in ATTiny10IDE, but there are some complex issues I have to sort our first.

Wayne

wholder avatar Oct 04 '19 10:10 wholder