Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
test struct and display
struct mystruct {
uint8_t x;
uint8_t y;
uint16_t u;
String name;
};
struct mystruct list[] = {
{0,1, 23425, "ไวไฟ"},
{0,2, 23426, "อินเตอร์เน็ต"},
{0,3, 23427, "เซนเซอร์"},
{0,4, 23428, "ไอโอที"},
{0,5, 23429, "อุณหภูมิ"},
{0,6, 23430, "ความชื้น"},
{0,7, 23431, "ความสว่าง"},
{0,8, 23432, "มอเตอร์"},
{0,9, 23433, "เซอร์โว"},
{0,10, 23434, "เครื่องทำความร้อน"},
{0,11, 23435, "เครือ่งทำความเย็น"},
{0,12, 23436, "เครื่องซักผ้า"},
{0,13, 23437, "ตู้เย็น"},
{0,14, 23438, "ทีวี"},
{0,15, 23439, "วิทยุ"},
{0,16, 23440, "โทรศัพท์"},
{0,17, 23441, "คอมพิวเตอร์"},
{0,18, 23442, "มือถือ"},
{0,19, 23443, "ไอโฟน"},
{0,20, 23444, "ซัมซุง"},
{0,21, 23445, "แอนดรอยด์"},
{0,22, 23446, "วินโดว์"},
{0,23, 23447, "Arduino"},
{0,24, 23448, "ผึ้ง"},
{0,25, 23449, "ยุง"},
{0,26, 23450, "หมี"},
{0,27, 23451, "Tiger"},
{0,28, 23452, "Water"},
{0,29, 23453, "ไฟฟ้า"},
{0,30, 23454, "บัญชี"},
};
void setup() {
Serial.begin(115200);
for(int i =0; i < 30; i++){
Serial.printf("%d,%d\t%04x\t%s\n", list[i].x, list[i].y, list[i].u, list[i].name.c_str());
}
}
void loop() {
// put your main code here, to run repeatedly:
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment