Tell us about yourself!

Complete Your Profile
  • IOT Made Simple: Playing With the ESP32 on Arduino IDE

    I have the following sketch working on an arduino mega. The pins are connected to a dartboard. When a segment is hit, it sends two values (i,j) to the serial monitor. Will this work on an esp32? Can I use the pins that I have listed in the arrays? Thanks.int masterLines = 11; //Change here to the number of lines of your Master Layerint slaveLines = 8; //Change here to the number of lines of your Slave Layerint matrixMaster[] = {36, 39, 34, 35, 32, 33, 25, 26, 27, 14, 12}; //Put here the pins you connected the lines of your Master Layerint matrixSlave[] = {23, 22, 21, 19, 18, 5, 17, 16}; //Put here the pins you connected the lines of your Slave Layervoid setup() { Serial.begin(115200); for(int i = 0; i < slaveLines; i++){ pinMode(matrixSlave[i], INPUT_PULLUP); } ...

    see more »

    I have the following sketch working on an arduino mega. The pins are connected to a dartboard. When a segment is hit, it sends two values (i,j) to the serial monitor. Will this work on an esp32? Can I use the pins that I have listed in the arrays? Thanks.int masterLines = 11; //Change here to the number of lines of your Master Layerint slaveLines = 8; //Change here to the number of lines of your Slave Layerint matrixMaster[] = {36, 39, 34, 35, 32, 33, 25, 26, 27, 14, 12}; //Put here the pins you connected the lines of your Master Layerint matrixSlave[] = {23, 22, 21, 19, 18, 5, 17, 16}; //Put here the pins you connected the lines of your Slave Layervoid setup() { Serial.begin(115200); for(int i = 0; i < slaveLines; i++){ pinMode(matrixSlave[i], INPUT_PULLUP); } for(int i = 0; i < masterLines; i++){ pinMode(matrixMaster[i], OUTPUT); digitalWrite(matrixMaster[i], HIGH); }}void loop() { for(int i = 0; i < masterLines; i++){ digitalWrite(matrixMaster[i], LOW); for(int j = 0; j < slaveLines; j++){ if(digitalRead(matrixSlave[j]) == LOW){ Serial.print(j); Serial.print(","); Serial.println(i); delay(500); break; } } digitalWrite(matrixMaster[i], HIGH); }}

    View Instructable »