Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part information to bring breadboard (with LED, LDR, switch) back. #1295

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libs/core/pinsAnalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ namespace AnalogInPinMethods {
//% help=pins/analog-read weight=53
//% blockId=device_get_analog_pin block="analog read|pin %name" blockGap="8"
//% blockNamespace=pins
//% parts="photocell"
//% name.fieldEditor="gridpicker"
//% name.fieldOptions.width=220
//% name.fieldOptions.columns=4
//% trackArgs=0
int analogRead(AnalogInPin name) {
return PINOP(getAnalogValue());
}
Expand All @@ -28,10 +30,12 @@ void analogWrite(AnalogOutPin name, int value) __attribute__ ((weak));
//% help=pins/analog-write weight=52
//% blockId=device_set_analog_pin block="analog write|pin %name|to %value" blockGap=8
//% blockNamespace=pins
//%parts="analogled"
//% name.fieldEditor="gridpicker"
//% name.fieldOptions.width=220
//% name.fieldOptions.columns=4
//% value.min=0 value.max=1023
//% trackArgs=0
void analogWrite(AnalogOutPin name, int value) {
PINOP(setAnalogValue(value));
}
Expand Down
6 changes: 6 additions & 0 deletions libs/core/pinsDigital.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ namespace DigitalInOutPinMethods {
//% help=pins/digital-read weight=61
//% blockId=device_get_digital_pin block="digital read|pin %name" blockGap=8
//% blockNamespace=pins
//% parts="slideswitch"
//% name.fieldEditor="gridpicker"
//% name.fieldOptions.width=220
//% name.fieldOptions.columns=4
//% trackArgs=0
bool digitalRead(DigitalInOutPin name) {
return PINOP(getDigitalValue()) != 0;
}
Expand All @@ -50,9 +52,11 @@ bool digitalRead(DigitalInOutPin name) {
//% help=pins/digital-write weight=60
//% blockId=device_set_digital_pin block="digital write|pin %name|to %value=toggleHighLow"
//% blockNamespace=pins
//% parts="led"
//% name.fieldEditor="gridpicker"
//% name.fieldOptions.width=220
//% name.fieldOptions.columns=4
//% trackArgs=0
void digitalWrite(DigitalInOutPin name, bool value) {
PINOP(setDigitalValue(value));
}
Expand All @@ -79,9 +83,11 @@ void onPulsed(DigitalInOutPin pin, PulseValue pulse, Action body) {
//% help=pins/on-event weight=20 blockGap=8
//% blockId=pinsonevent block="on|pin %pin|%event"
//% blockNamespace=pins
//% parts="slideswitch"
//% pin.fieldEditor="gridpicker"
//% pin.fieldOptions.width=220
//% pin.fieldOptions.columns=4
//% trackArgs=0
void onEvent(DigitalInOutPin pin, PinEvent event, Action body) {
switch(event) {
case PinEvent::PulseHigh:
Expand Down