Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

circuit playground simulator analog input
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

circuit playground simulator analog input

by jfalboSCC on Tue Jun 09, 2020 10:26 am

Hi just looking to learn how to use the CPX simulator for analog inputs. I see blue on one click, and gold on another, but don't seem to register a high or 1?
Can't adjust analog input either.
Thanks

jfalboSCC
 
Posts: 1
Joined: Sun May 10, 2020 8:25 pm

Re: circuit playground simulator analog input

by johnpark on Fri Jun 12, 2020 3:37 pm

I don't think there's a way to simulate analog voltage in the CPX simulator. You can see in this example that you can measure light level in the console as a varying value, thanks to the added circle widget that shows up, but clicking on the A1 pad doesn't really do that.
Code: Select all | TOGGLE FULL SIZE
forever(function () {
    console.logValue("A1", pins.A1.analogRead())
    console.logValue("light", input.lightLevel())
})


UPDATE: using Maker.makecode.com gives you a way to simulated analog read: https://makecode.com/_Vwy7uU6LDKFd

johnpark
 
Posts: 767
Joined: Wed Mar 25, 2009 2:15 pm

Please be positive and constructive with your questions and comments.